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 != "" {
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
}