mirror of
https://github.com/containers/podman.git
synced 2025-12-12 09:50:25 +08:00
Ran a `go get -u` and bumped K8s deps to 1.15.0. Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
21 lines
456 B
Go
21 lines
456 B
Go
package hcs
|
|
|
|
import "github.com/sirupsen/logrus"
|
|
|
|
func logOperationBegin(ctx logrus.Fields, msg string) {
|
|
logrus.WithFields(ctx).Debug(msg)
|
|
}
|
|
|
|
func logOperationEnd(ctx logrus.Fields, msg string, err error) {
|
|
// Copy the log and fields first.
|
|
log := logrus.WithFields(ctx)
|
|
if err == nil {
|
|
log.Debug(msg)
|
|
} else {
|
|
// Edit only the copied field data to avoid race conditions on the
|
|
// write.
|
|
log.Data[logrus.ErrorKey] = err
|
|
log.Error(msg)
|
|
}
|
|
}
|