Skip to content

Commit 3d1e1cd

Browse files
committed
🍬 logging: re-enable color for systemd preset
You can get systemctl status and journalctl to preserve colors with --all.
1 parent ed609ba commit 3d1e1cd

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

logging/zap.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ import (
1717
// - "console" (default): Reasonable defaults for production console environments.
1818
// - "console-nocolor": Same as "console", but without color.
1919
// - "console-notime": Same as "console", but without timestamps.
20-
// - "systemd": Reasonable defaults for running as a systemd service. Same as "console", but without color and timestamps.
20+
// - "console-nocolor-notime": Same as "console", but without color and timestamps.
21+
// - "systemd": Reasonable defaults for running as a systemd service. Alias for "console-notime".
2122
// - "production": Zap's built-in production preset.
2223
// - "development": Zap's built-in development preset.
2324
//
@@ -30,9 +31,9 @@ func NewZapLogger(preset string, level zapcore.Level) (*zap.Logger, error) {
3031
return NewProductionConsoleZapLogger(level, false, false, false), nil
3132
case "console-nocolor":
3233
return NewProductionConsoleZapLogger(level, true, false, false), nil
33-
case "console-notime":
34+
case "console-notime", "systemd":
3435
return NewProductionConsoleZapLogger(level, false, true, false), nil
35-
case "systemd":
36+
case "console-nocolor-notime":
3637
return NewProductionConsoleZapLogger(level, true, true, false), nil
3738
}
3839

0 commit comments

Comments
 (0)