You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: journal.go
+24-2Lines changed: 24 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -37,6 +37,7 @@ type LevelVar struct {
37
37
}
38
38
39
39
// Return v's level.
40
+
// When invoked for the first time, checks if the environment variable DEBUG_INVOCATION is set and if so, sets the level to slog.LevelDebug before returning it.
40
41
func (v*LevelVar) Level() slog.Level {
41
42
sync.OnceFunc(func() {
42
43
ifos.Getenv("DEBUG_INVOCATION") !="" {
@@ -102,12 +103,14 @@ type Handler struct {
102
103
103
104
constsndBufSize=8*1024*1024
104
105
105
-
// NewHandler returns a new Handler that writes to the systemd journal.
106
+
// NewHandler returns a new Handler that writes to the [systemd journal].
106
107
// The journal only accepts keys of the form ^[A-Z_][A-Z0-9_]*$.
107
108
// If opts is nil, the default options are used.
108
109
// If opts.Level is nil, the default level is a [LevelVar] which is equivalent to
109
110
// slog.LevelInfo unless the environment variable DEBUG_INVOCATION is set, in
0 commit comments