mirror of https://github.com/sirupsen/logrus.git
Make Writer() methods inherit their receiver's log level instead of defaulting to InfoLevel
This commit is contained in:
parent
dae0fa8d5b
commit
f2d7ee2270
|
@ -7,7 +7,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func (logger *Logger) Writer() *io.PipeWriter {
|
func (logger *Logger) Writer() *io.PipeWriter {
|
||||||
return logger.WriterLevel(InfoLevel)
|
return logger.WriterLevel(logger.GetLevel())
|
||||||
}
|
}
|
||||||
|
|
||||||
func (logger *Logger) WriterLevel(level Level) *io.PipeWriter {
|
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 {
|
func (entry *Entry) Writer() *io.PipeWriter {
|
||||||
return entry.WriterLevel(InfoLevel)
|
return entry.WriterLevel(entry.Logger.GetLevel())
|
||||||
}
|
}
|
||||||
|
|
||||||
func (entry *Entry) WriterLevel(level Level) *io.PipeWriter {
|
func (entry *Entry) WriterLevel(level Level) *io.PipeWriter {
|
||||||
|
|
Loading…
Reference in New Issue