mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-30 15:05:27 +00:00
logs: work around logcheck
logcheck complains: Additional arguments to ErrorS should always be Key Value pairs. Please check if there is any key or value missing. That check is intentional, but not applicable here. The check can be worked around by calling the functions through variables.
This commit is contained in:
parent
072859c967
commit
b8501fc10b
@ -70,10 +70,17 @@ func printf(item logMessage) {
|
||||
}
|
||||
}
|
||||
|
||||
// These variables are a workaround for logcheck complaining about the dynamic
|
||||
// parameters.
|
||||
var (
|
||||
errorS = klog.ErrorS
|
||||
infoS = klog.InfoS
|
||||
)
|
||||
|
||||
func prints(item logMessage) {
|
||||
if item.isError {
|
||||
klog.ErrorS(item.err, item.msg, item.kvs...)
|
||||
errorS(item.err, item.msg, item.kvs...)
|
||||
} else {
|
||||
klog.InfoS(item.msg, item.kvs...)
|
||||
infoS(item.msg, item.kvs...)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user