From f2d7ee22705b270749f36ab59ddfee798df95c04 Mon Sep 17 00:00:00 2001 From: "Daniel M. Lambea" Date: Thu, 14 Mar 2019 14:29:42 +0000 Subject: [PATCH] Make Writer() methods inherit their receiver's log level instead of defaulting to InfoLevel --- writer.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/writer.go b/writer.go index 9e1f751..6374fc2 100644 --- a/writer.go +++ b/writer.go @@ -7,7 +7,7 @@ import ( ) func (logger *Logger) Writer() *io.PipeWriter { - return logger.WriterLevel(InfoLevel) + return logger.WriterLevel(logger.GetLevel()) } func (logger *Logger) WriterLevel(level Level) *io.PipeWriter { @@ -15,7 +15,7 @@ func (logger *Logger) WriterLevel(level Level) *io.PipeWriter { } func (entry *Entry) Writer() *io.PipeWriter { - return entry.WriterLevel(InfoLevel) + return entry.WriterLevel(entry.Logger.GetLevel()) } func (entry *Entry) WriterLevel(level Level) *io.PipeWriter {