Commit f92380ce authored by Tomasz Maczukin's avatar Tomasz Maczukin

Specify logger explicitly when using AddSecretsClenupLogHook

parent 304f2d17
......@@ -40,7 +40,7 @@ func main() {
logrus.Fatalln("Command", command, "not found")
}
log.AddSecretsCleanupLogHook()
log.AddSecretsCleanupLogHook(logrus.StandardLogger())
log.ConfigureLogging(app)
if err := app.Run(os.Args); err != nil {
......
......@@ -17,6 +17,10 @@ func (s *SecretsCleanupHook) Fire(entry *logrus.Entry) error {
return nil
}
func AddSecretsCleanupLogHook() {
logrus.AddHook(new(SecretsCleanupHook))
func AddSecretsCleanupLogHook(logger *logrus.Logger) {
if logger == nil {
logger = logrus.StandardLogger()
}
logger.AddHook(new(SecretsCleanupHook))
}
......@@ -32,7 +32,7 @@ func TestSecretsCleanupHook(t *testing.T) {
logger := logrus.New()
logger.Out = buffer
logger.AddHook(new(SecretsCleanupHook))
AddSecretsCleanupLogHook(logger)
logger.Errorln(test.message)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment