diff --git a/zero/logger.go b/zero/logrus.go similarity index 55% rename from zero/logger.go rename to zero/logrus.go index 09028c0..b935fae 100644 --- a/zero/logger.go +++ b/zero/logrus.go @@ -9,11 +9,19 @@ import ( // Logger returns a no-op logrus.Logger. func Logger() *logrus.Logger { return noopLogger } -var noopLogger *logrus.Logger +// Entry returns a no-op logrus.Entry. +func Entry() *logrus.Entry { return noopEntry } -// Initialize noopLogger. +var ( + noopLogger *logrus.Logger + noopEntry *logrus.Entry +) + +// Initialize noopLogger, noopEntry. func init() { noopLogger = logrus.New() noopLogger.SetLevel(logrus.PanicLevel) noopLogger.SetOutput(ioutil.Discard) + + noopEntry = logrus.NewEntry(noopLogger) } diff --git a/zero/logger_test.go b/zero/logrus_test.go similarity index 100% rename from zero/logger_test.go rename to zero/logrus_test.go