Skip to content

Commit bcd01d4

Browse files
committed
Fix logging for successful match
1 parent a32db8d commit bcd01d4

File tree

1 file changed

+4
-5
lines changed
  • components/ee/agent-smith/pkg/agent

1 file changed

+4
-5
lines changed

components/ee/agent-smith/pkg/agent/agent.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -401,12 +401,11 @@ func (agent *Smith) Start(ctx context.Context, callback func(InfringingWorkspace
401401
log.WithError(err).WithFields(log.OWI(file.Workspace.OwnerID, file.Workspace.WorkspaceID, file.Workspace.InstanceID)).WithField("path", file.Path).Error("cannot classify filesystem file")
402402
continue
403403
}
404-
if cl == nil || cl.Level == classifier.LevelNoMatch {
405-
log.Warn("filesystem signature not detected", "path", file.Path, "workspace", file.Workspace.WorkspaceID)
406-
continue
407-
}
408404

409-
log.Info("filesystem signature detected", "path", file.Path, "workspace", file.Workspace.WorkspaceID, "severity", cl.Level, "message", cl.Message)
405+
log.WithField("path", file.Path).WithField("severity", cl.Level).WithField("message", cl.Message).
406+
WithFields(log.OWI(file.Workspace.OwnerID, file.Workspace.WorkspaceID, file.Workspace.InstanceID)).
407+
Info("filesystem signature detected")
408+
410409
_, _ = agent.Penalize(InfringingWorkspace{
411410
SupervisorPID: file.Workspace.PID,
412411
Owner: file.Workspace.OwnerID,

0 commit comments

Comments
 (0)