mirror of https://github.com/sirupsen/logrus.git
disable colors on hook example
This commit is contained in:
parent
f2ab87f230
commit
9c7692ccff
|
@ -24,8 +24,7 @@ func (h *GlobalHook) Fire(e *logrus.Entry) error {
|
||||||
func Example() {
|
func Example() {
|
||||||
l := logrus.New()
|
l := logrus.New()
|
||||||
l.Out = os.Stdout
|
l.Out = os.Stdout
|
||||||
l.Formatter = &logrus.TextFormatter{DisableTimestamp: true}
|
l.Formatter = &logrus.TextFormatter{DisableTimestamp: true, DisableColors: true}
|
||||||
l.Formatter.(*logrus.TextFormatter).DisableTimestamp = true
|
|
||||||
l.AddHook(&GlobalHook{})
|
l.AddHook(&GlobalHook{})
|
||||||
mystring = "first value"
|
mystring = "first value"
|
||||||
l.Info("first log")
|
l.Info("first log")
|
||||||
|
|
Loading…
Reference in New Issue