v1.9.0
ADD: * `iox` subpackage FIX: * `logging` now has a way to return logWritier directly * added significant `io.*` interface compat to logWriter -- allowing a `logging.Logger` to essentially be used for a large amount of io interaction in other libraries.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
package logging
|
||||
|
||||
import (
|
||||
`log`
|
||||
"log"
|
||||
)
|
||||
|
||||
// Setup does nothing at all; it's here for interface compat. 🙃
|
||||
@@ -84,3 +84,11 @@ func (l *NullLogger) ToLogger(prio logPrio) (stdLibLog *log.Logger) {
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ToRaw returns a *logWriter. (This is a little less efficient than using ToLogger's log.Logger as an io.Writer if that's all you need.)
|
||||
func (l *NullLogger) ToRaw(prio logPrio) (raw *logWriter) {
|
||||
|
||||
raw = &logWriter{backend: l, prio: prio}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user