Skip to content

Commit 2dfc134

Browse files
authored
fix: Actually do debug logging (#4851)
Currently all debug logs are dropped in google cloud with no option to enable them
1 parent 64745ff commit 2dfc134

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

deployment/clouddeploy/gke-workers/base/gitter.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ spec:
3232
env:
3333
- name: GOMEMLIMIT
3434
value: "100GiB"
35+
- name: DEBUG_LOG
36+
value: "true"
3537
volumeMounts:
3638
- mountPath: /work
3739
name: disk-data

go/logger/init.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,14 @@ func initTracing(ctx context.Context, projectID, serviceName string) {
118118
}
119119

120120
func cloudHandlerOptions() *slog.HandlerOptions {
121+
level := slog.LevelInfo
122+
if os.Getenv("DEBUG_LOG") != "" {
123+
level = slog.LevelDebug
124+
}
125+
121126
return &slog.HandlerOptions{
122127
AddSource: true,
128+
Level: level,
123129
ReplaceAttr: func(_ []string, a slog.Attr) slog.Attr {
124130
// Remap "level" to "severity"
125131
if a.Key == slog.LevelKey {

0 commit comments

Comments
 (0)