improve interop with other libs/stdlib
This commit is contained in:
@@ -1,9 +1,33 @@
|
||||
package logging
|
||||
|
||||
import (
|
||||
"log"
|
||||
"os"
|
||||
)
|
||||
|
||||
/*
|
||||
ToLog returns a stdlib *log.Logger from a logging.Logger. It simply wraps the (logging.Logger).ToLogger() methods.
|
||||
|
||||
prio is an OR'd logPrio of the Priority* constants.
|
||||
*/
|
||||
func ToLog(l Logger, prio logPrio) (stdLibLog *log.Logger) {
|
||||
|
||||
stdLibLog = l.ToLogger(prio)
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ToRaw returns a *logWriter from a logging.Logger. It is an alternative to the (logging.Logger).ToRaw() methods.
|
||||
func ToRaw(l Logger, prio logPrio) (raw *logWriter) {
|
||||
|
||||
raw = &logWriter{
|
||||
backend: l,
|
||||
prio: prio,
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// testOpen attempts to open a file for writing to test for suitability as a LogFile path.
|
||||
func testOpen(path string) (success bool, err error) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user