From 629982b4957da4679c12227a2b3d09dd42f659d2 Mon Sep 17 00:00:00 2001 From: Mark Dittmer Date: Tue, 18 Sep 2018 13:54:23 -0400 Subject: [PATCH] DisableColors in two tests to fix AppEngine configuration --- example_basic_test.go | 4 +++- example_hook_test.go | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/example_basic_test.go b/example_basic_test.go index a2acf55..5f3849b 100644 --- a/example_basic_test.go +++ b/example_basic_test.go @@ -1,14 +1,16 @@ package logrus_test import ( - "github.com/sirupsen/logrus" "os" + + "github.com/sirupsen/logrus" ) func Example_basic() { var log = logrus.New() log.Formatter = new(logrus.JSONFormatter) log.Formatter = new(logrus.TextFormatter) //default + log.Formatter.(*logrus.TextFormatter).DisableColors = true // remove colors log.Formatter.(*logrus.TextFormatter).DisableTimestamp = true // remove timestamp from test output log.Level = logrus.DebugLevel log.Out = os.Stdout diff --git a/example_hook_test.go b/example_hook_test.go index 28bd8ea..15118d2 100644 --- a/example_hook_test.go +++ b/example_hook_test.go @@ -3,16 +3,18 @@ package logrus_test import ( - "github.com/sirupsen/logrus" - slhooks "github.com/sirupsen/logrus/hooks/syslog" "log/syslog" "os" + + "github.com/sirupsen/logrus" + slhooks "github.com/sirupsen/logrus/hooks/syslog" ) // An example on how to use a hook func Example_hook() { var log = logrus.New() log.Formatter = new(logrus.TextFormatter) // default + log.Formatter.(*logrus.TextFormatter).DisableColors = true // remove colors log.Formatter.(*logrus.TextFormatter).DisableTimestamp = true // remove timestamp from test output if sl, err := slhooks.NewSyslogHook("udp", "localhost:514", syslog.LOG_INFO, ""); err != nil { log.Hooks.Add(sl)