mirror of
https://github.com/aljazceru/kata-containers.git
synced 2026-01-27 18:24:26 +01:00
virtcontainers: Fix structured logging in cgroups package
Call the `pkg/cgroups` package `SetLogger()` function to ensure all its log records contain all required structured logging fields. Fixes: #2782 Signed-off-by: Julio Montes <julio.montes@intel.com>
This commit is contained in:
@@ -59,6 +59,13 @@ var (
|
||||
cgroupsLogger = logrus.WithField("source", "virtcontainers/pkg/cgroups")
|
||||
)
|
||||
|
||||
// SetLogger sets up a logger for this pkg
|
||||
func SetLogger(logger *logrus.Entry) {
|
||||
fields := cgroupsLogger.Data
|
||||
|
||||
cgroupsLogger = logger.WithFields(fields)
|
||||
}
|
||||
|
||||
func EnableSystemdCgroup() {
|
||||
systemd := true
|
||||
systemdCgroup = &systemd
|
||||
|
||||
Reference in New Issue
Block a user