1
Fork 0
mirror of https://github.com/caddyserver/caddy.git synced 2024-12-16 21:56:40 -05:00

cmd: Use formatted logger for config adapter warnings (#4080)

This commit is contained in:
Francis Lavoie 2021-03-29 13:03:50 -04:00 committed by GitHub
parent 87fbc0783a
commit 911c8a371a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -185,7 +185,7 @@ func loadConfig(configFile, adapterName string) ([]byte, string, error) {
if warn.Directive != "" { if warn.Directive != "" {
msg = fmt.Sprintf("%s: %s", warn.Directive, warn.Message) msg = fmt.Sprintf("%s: %s", warn.Directive, warn.Message)
} }
fmt.Printf("[WARNING][%s] %s:%d: %s\n", adapterName, warn.File, warn.Line, msg) caddy.Log().Warn(msg, zap.String("adapter", adapterName), zap.String("file", warn.File), zap.Int("line", warn.Line))
} }
config = adaptedConfig config = adaptedConfig
} }