You've already forked docker-volume-backup
mirror of
https://github.com/offen/docker-volume-backup.git
synced 2025-11-23 21:44:40 +02:00
Print context in log field instead of prepending to message (#260)
* Print context in log field instead of prepending to message * Log messages on pruning do not need a description anymore * Remove redundant information from logs and errors
This commit is contained in:
@@ -126,11 +126,11 @@ func newScript() (*script, error) {
|
||||
logFunc := func(logType storage.LogLevel, context string, msg string, params ...any) {
|
||||
switch logType {
|
||||
case storage.LogLevelWarning:
|
||||
s.logger.Warn(fmt.Sprintf("["+context+"] "+msg, params...))
|
||||
s.logger.Warn(fmt.Sprintf(msg, params...), "storage", context)
|
||||
case storage.LogLevelError:
|
||||
s.logger.Error(fmt.Sprintf("["+context+"] "+msg, params...))
|
||||
s.logger.Error(fmt.Sprintf(msg, params...), "storage", context)
|
||||
default:
|
||||
s.logger.Info(fmt.Sprintf("["+context+"] "+msg, params...))
|
||||
s.logger.Info(fmt.Sprintf(msg, params...), "storage", context)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user