mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-08-17 15:38:00 +00:00
virtcontainers: Fix structured logging in device/config package
[cherry picked from runtime commit d0dbd0485d2f4ec3760f6fa1252ded86a7709042] Call the `device/config` package `SetLogger()` function to ensure all its log records contain all required structured logging fields. Signed-off-by: Julio Montes <julio.montes@intel.com> Signed-off-by: Peng Tao <bergwolf@hyper.sh>
This commit is contained in:
parent
422768082d
commit
eed66021da
@ -52,6 +52,7 @@ func SetLogger(ctx context.Context, logger *logrus.Entry) {
|
||||
deviceApi.SetLogger(virtLog)
|
||||
compatoci.SetLogger(virtLog)
|
||||
store.SetLogger(virtLog)
|
||||
deviceConfig.SetLogger(virtLog)
|
||||
}
|
||||
|
||||
// CreateSandbox is the virtcontainers sandbox creation entry point.
|
||||
|
@ -29,6 +29,13 @@ var (
|
||||
pmemLog = logrus.WithField("source", "virtcontainers/device/config")
|
||||
)
|
||||
|
||||
// SetLogger sets up a logger for this pkg
|
||||
func SetLogger(logger *logrus.Entry) {
|
||||
fields := pmemLog.Data
|
||||
|
||||
pmemLog = logger.WithFields(fields)
|
||||
}
|
||||
|
||||
// PmemDeviceInfo returns a DeviceInfo if a loop device
|
||||
// is mounted on source, and the backing file of the loop device
|
||||
// has the PFN signature.
|
||||
|
Loading…
Reference in New Issue
Block a user