From 94267cf6dd03abacb35018a49c34532d824ce28d Mon Sep 17 00:00:00 2001 From: Martin/Geno Date: Wed, 27 Feb 2019 02:51:01 +0100 Subject: [PATCH] not export logging stdout / stderr hook --- main.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/main.go b/main.go index 6e63ad2..86e6718 100644 --- a/main.go +++ b/main.go @@ -9,9 +9,9 @@ import ( "github.com/FreifunkBremen/yanic/cmd" ) -type Hook struct{} +type hook struct{} -func (hook *Hook) Fire(entry *log.Entry) error { +func (h *hook) Fire(entry *log.Entry) error { switch entry.Level { case log.PanicLevel: entry.Logger.Out = os.Stderr @@ -31,12 +31,12 @@ func (hook *Hook) Fire(entry *log.Entry) error { return nil } -func (hook *Hook) Levels() []stdLogger.Level { +func (h *hook) Levels() []stdLogger.Level { return log.AllLevels } func main() { - log.AddHook(&Hook{}) + log.AddHook(&hook{}) cmd.Execute() }