From 9c7692ccff2dca67e6db9b6eaef21a2c37ad82e7 Mon Sep 17 00:00:00 2001 From: David Bariod Date: Mon, 15 Oct 2018 21:32:20 +0200 Subject: [PATCH] disable colors on hook example --- example_global_hook_test.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/example_global_hook_test.go b/example_global_hook_test.go index df1584c..c81e448 100644 --- a/example_global_hook_test.go +++ b/example_global_hook_test.go @@ -24,8 +24,7 @@ func (h *GlobalHook) Fire(e *logrus.Entry) error { func Example() { l := logrus.New() l.Out = os.Stdout - l.Formatter = &logrus.TextFormatter{DisableTimestamp: true} - l.Formatter.(*logrus.TextFormatter).DisableTimestamp = true + l.Formatter = &logrus.TextFormatter{DisableTimestamp: true, DisableColors: true} l.AddHook(&GlobalHook{}) mystring = "first value" l.Info("first log")