Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ func (p *podEventLogger) initNamespace(namespace string) error {
p.sendLog(pod.Name, token, agentsdk.Log{
CreatedAt: time.Now(),
Output: fmt.Sprintf("🐳 %s: %s", newColor(color.Bold).Sprint("Created pod"), pod.Name),
Level: codersdk.LogLevelInfo,
Level: codersdk.LogLevelDebug,
})
}
}
Expand Down Expand Up @@ -287,7 +287,7 @@ func (p *podEventLogger) initNamespace(namespace string) error {
p.sendLog(replicaSet.Name, token, agentsdk.Log{
CreatedAt: time.Now(),
Output: fmt.Sprintf("🐳 %s: %s", newColor(color.Bold).Sprint("Queued pod from ReplicaSet"), replicaSet.Name),
Level: codersdk.LogLevelInfo,
Level: codersdk.LogLevelDebug,
})
}
}
Expand Down Expand Up @@ -351,7 +351,7 @@ func (p *podEventLogger) initNamespace(namespace string) error {
p.sendLog(event.InvolvedObject.Name, token, agentsdk.Log{
CreatedAt: time.Now(),
Output: newColor(color.FgWhite).Sprint(event.Message),
Level: codersdk.LogLevelInfo,
Level: codersdk.LogLevelDebug,
})
p.logger.Info(p.ctx, "sending log", slog.F("pod", event.InvolvedObject.Name), slog.F("message", event.Message))
}
Expand Down
16 changes: 8 additions & 8 deletions logger_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,7 @@ func Test_logQueuer(t *testing.T) {
log: agentsdk.Log{
CreatedAt: time.Now(),
Output: "This is a log.",
Level: codersdk.LogLevelInfo,
Level: codersdk.LogLevelDebug,
},
}

Expand All @@ -700,7 +700,7 @@ func Test_logQueuer(t *testing.T) {
log: agentsdk.Log{
CreatedAt: time.Now(),
Output: "This is a log too.",
Level: codersdk.LogLevelInfo,
Level: codersdk.LogLevelDebug,
},
}

Expand Down Expand Up @@ -752,7 +752,7 @@ func Test_logQueuer(t *testing.T) {
log: agentsdk.Log{
CreatedAt: time.Now(),
Output: "This is a log.",
Level: codersdk.LogLevelInfo,
Level: codersdk.LogLevelDebug,
},
}

Expand Down Expand Up @@ -915,7 +915,7 @@ func Test_logQueuer(t *testing.T) {
log: agentsdk.Log{
CreatedAt: time.Now(),
Output: "This is a log.",
Level: codersdk.LogLevelInfo,
Level: codersdk.LogLevelDebug,
},
}

Expand Down Expand Up @@ -973,7 +973,7 @@ func Test_logCache(t *testing.T) {
log: agentsdk.Log{
CreatedAt: time.Now(),
Output: "First log",
Level: codersdk.LogLevelInfo,
Level: codersdk.LogLevelDebug,
},
}
returnedLogs := lc.push(log1)
Expand Down Expand Up @@ -1021,7 +1021,7 @@ func Test_logCache(t *testing.T) {
log: agentsdk.Log{
CreatedAt: time.Now(),
Output: "Test log",
Level: codersdk.LogLevelInfo,
Level: codersdk.LogLevelDebug,
},
}
lc.push(log)
Expand Down Expand Up @@ -1054,7 +1054,7 @@ func Test_logCache(t *testing.T) {
log: agentsdk.Log{
CreatedAt: time.Now(),
Output: "Log for token1",
Level: codersdk.LogLevelInfo,
Level: codersdk.LogLevelDebug,
},
}
log2 := agentLog{
Expand Down Expand Up @@ -1149,7 +1149,7 @@ func Test_logCache(t *testing.T) {
log: agentsdk.Log{
CreatedAt: time.Now(),
Output: "Real log",
Level: codersdk.LogLevelInfo,
Level: codersdk.LogLevelDebug,
},
}
ch <- realLog
Expand Down