mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-08-15 06:34:03 +00:00
Merge pull request #1298 from jodh-intel/store-pkg-add-SetLogger
store: Add SetLogger API
This commit is contained in:
commit
dbfd96583a
@ -48,6 +48,7 @@ func SetLogger(ctx context.Context, logger *logrus.Entry) {
|
||||
virtLog = logger.WithFields(fields)
|
||||
|
||||
deviceApi.SetLogger(virtLog)
|
||||
store.SetLogger(virtLog)
|
||||
}
|
||||
|
||||
// CreateSandbox is the virtcontainers sandbox creation entry point.
|
||||
|
@ -182,6 +182,13 @@ func DeleteAll() {
|
||||
|
||||
var storeLog = logrus.WithField("source", "virtcontainers/store")
|
||||
|
||||
// SetLogger sets the custom logger to be used by this package. If not called,
|
||||
// the package will create its own logger.
|
||||
func SetLogger(logger *logrus.Entry) {
|
||||
fields := storeLog.Data
|
||||
storeLog = logger.WithFields(fields)
|
||||
}
|
||||
|
||||
// Logger returns a logrus logger appropriate for logging Store messages
|
||||
func (s *Store) Logger() *logrus.Entry {
|
||||
return storeLog.WithFields(logrus.Fields{
|
||||
|
Loading…
Reference in New Issue
Block a user