Make Writer() methods inherit their receiver's log level instead of defaulting to InfoLevel

This commit is contained in:
Daniel M. Lambea 2019-03-14 14:29:42 +00:00
parent dae0fa8d5b
commit f2d7ee2270
1 changed files with 2 additions and 2 deletions

View File

@ -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 {