mirror of
https://github.com/TecharoHQ/anubis.git
synced 2026-04-16 05:15:03 +00:00
feat(logging): add option to hide log line source
This is almost certainly going to be a footgun, but it's not too bad of a change to make. If users really do want to make getting support more difficult, so be it. Closes: #1537 Signed-off-by: Xe Iaso <me@xeiaso.net>
This commit is contained in:
@@ -75,7 +75,7 @@ func ParseConfig(ctx context.Context, fin io.Reader, fname string, defaultDiffic
|
||||
|
||||
switch c.Logging.Sink {
|
||||
case config.LogSinkStdio:
|
||||
result.Logger = internal.InitSlog(logLevel, os.Stderr)
|
||||
result.Logger = internal.InitSlog(logLevel, os.Stderr, c.Logging.HideSource)
|
||||
case config.LogSinkFile:
|
||||
out := &logrotate.Logger{
|
||||
Filename: c.Logging.Parameters.Filename,
|
||||
@@ -87,7 +87,7 @@ func ParseConfig(ctx context.Context, fin io.Reader, fname string, defaultDiffic
|
||||
Compress: c.Logging.Parameters.Compress,
|
||||
}
|
||||
|
||||
result.Logger = internal.InitSlog(logLevel, out)
|
||||
result.Logger = internal.InitSlog(logLevel, out, c.Logging.HideSource)
|
||||
}
|
||||
|
||||
lg := result.Logger.With("at", "config-validate")
|
||||
|
||||
Reference in New Issue
Block a user