mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-08-16 07:05:14 +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)
|
virtLog = logger.WithFields(fields)
|
||||||
|
|
||||||
deviceApi.SetLogger(virtLog)
|
deviceApi.SetLogger(virtLog)
|
||||||
|
store.SetLogger(virtLog)
|
||||||
}
|
}
|
||||||
|
|
||||||
// CreateSandbox is the virtcontainers sandbox creation entry point.
|
// CreateSandbox is the virtcontainers sandbox creation entry point.
|
||||||
|
@ -182,6 +182,13 @@ func DeleteAll() {
|
|||||||
|
|
||||||
var storeLog = logrus.WithField("source", "virtcontainers/store")
|
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
|
// Logger returns a logrus logger appropriate for logging Store messages
|
||||||
func (s *Store) Logger() *logrus.Entry {
|
func (s *Store) Logger() *logrus.Entry {
|
||||||
return storeLog.WithFields(logrus.Fields{
|
return storeLog.WithFields(logrus.Fields{
|
||||||
|
Loading…
Reference in New Issue
Block a user