diff options
author | W. Trevor King <wking@tremily.us> | 2018-06-03 12:34:42 -0700 |
---|---|---|
committer | Atomic Bot <atomic-devel@projectatomic.io> | 2018-06-04 13:01:56 +0000 |
commit | 41a3f48f6d78b791181fb52c0cd9ac3fa94424f7 (patch) | |
tree | 762bb53c1624bf9ef089276294bff8a335dd99e3 /pkg/hooks/hooks.go | |
parent | d5bedf42cfaddd01eba88e267bc0fb8dbc1039ad (diff) | |
download | podman-41a3f48f6d78b791181fb52c0cd9ac3fa94424f7.tar.gz podman-41a3f48f6d78b791181fb52c0cd9ac3fa94424f7.tar.bz2 podman-41a3f48f6d78b791181fb52c0cd9ac3fa94424f7.zip |
hooks: Add debug logging for initial hook loading
We've had logrus logging in the monitor code since it landed in
68eb128f (pkg/hooks: Version the hook structure and add 1.0.0 hooks,
2018-04-27, #686). This commit adds similar logging to the initial
hook.New() and Manager.Hooks() calls to make it easier to see if those
are working as expected.
Signed-off-by: W. Trevor King <wking@tremily.us>
Closes: #887
Approved by: rhatdan
Diffstat (limited to 'pkg/hooks/hooks.go')
-rw-r--r-- | pkg/hooks/hooks.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/pkg/hooks/hooks.go b/pkg/hooks/hooks.go index d18cc1195..fdc8a6c46 100644 --- a/pkg/hooks/hooks.go +++ b/pkg/hooks/hooks.go @@ -10,6 +10,7 @@ import ( rspec "github.com/opencontainers/runtime-spec/specs-go" "github.com/pkg/errors" current "github.com/projectatomic/libpod/pkg/hooks/1.0.0" + "github.com/sirupsen/logrus" "golang.org/x/text/collate" "golang.org/x/text/language" ) @@ -112,6 +113,7 @@ func (m *Manager) Hooks(config *rspec.Spec, annotations map[string]string, hasBi return extensionStageHooks, errors.Wrapf(err, "matching hook %q", namedHook.name) } if match { + logrus.Debugf("hook %s matched; adding to stages %v", namedHook.name, namedHook.hook.Stages) if config.Hooks == nil { config.Hooks = &rspec.Hooks{} } @@ -134,6 +136,8 @@ func (m *Manager) Hooks(config *rspec.Spec, annotations map[string]string, hasBi } } } + } else { + logrus.Debugf("hook %s did not match", namedHook.name) } } |