e5191383a7
ADDED: * logging.Logger objects now are able to return a stdlib *log.Logger.
87 lines
2.2 KiB
Go
87 lines
2.2 KiB
Go
package logging
|
|
|
|
import (
|
|
`log`
|
|
)
|
|
|
|
// Setup does nothing at all; it's here for interface compat. 🙃
|
|
func (l *NullLogger) Setup() (err error) {
|
|
return
|
|
}
|
|
|
|
// DoDebug does nothing at all; it's here for interface compat. 🙃
|
|
func (l *NullLogger) DoDebug(d bool) (err error) {
|
|
return
|
|
}
|
|
|
|
// GetDebug returns the debug status of this NullLogger. It will always return true. 🙃
|
|
func (n *NullLogger) GetDebug() (d bool) {
|
|
|
|
d = true
|
|
|
|
return
|
|
}
|
|
|
|
// SetPrefix does nothing at all; it's here for interface compat. 🙃
|
|
func (l *NullLogger) SetPrefix(p string) (err error) {
|
|
return
|
|
}
|
|
|
|
// GetPrefix does nothing at all; it's here for interface compat. 🙃
|
|
func (l *NullLogger) GetPrefix() (p string, err error) {
|
|
return
|
|
}
|
|
|
|
// Shutdown does nothing at all; it's here for interface compat. 🙃
|
|
func (l *NullLogger) Shutdown() (err error) {
|
|
return
|
|
}
|
|
|
|
// Alert does nothing at all; it's here for interface compat. 🙃
|
|
func (l *NullLogger) Alert(s string, v ...interface{}) (err error) {
|
|
return
|
|
}
|
|
|
|
// Crit does nothing at all; it's here for interface compat. 🙃
|
|
func (l *NullLogger) Crit(s string, v ...interface{}) (err error) {
|
|
return
|
|
}
|
|
|
|
// Debug does nothing at all; it's here for interface compat. 🙃
|
|
func (l *NullLogger) Debug(s string, v ...interface{}) (err error) {
|
|
return
|
|
}
|
|
|
|
// Emerg does nothing at all; it's here for interface compat. 🙃
|
|
func (l *NullLogger) Emerg(s string, v ...interface{}) (err error) {
|
|
return
|
|
}
|
|
|
|
// Err does nothing at all; it's here for interface compat. 🙃
|
|
func (l *NullLogger) Err(s string, v ...interface{}) (err error) {
|
|
return
|
|
}
|
|
|
|
// Info does nothing at all; it's here for interface compat. 🙃
|
|
func (l *NullLogger) Info(s string, v ...interface{}) (err error) {
|
|
return
|
|
}
|
|
|
|
// Notice does nothing at all; it's here for interface compat. 🙃
|
|
func (l *NullLogger) Notice(s string, v ...interface{}) (err error) {
|
|
return
|
|
}
|
|
|
|
// Warning does nothing at all; it's here for interface compat. 🙃
|
|
func (l *NullLogger) Warning(s string, v ...interface{}) (err error) {
|
|
return
|
|
}
|
|
|
|
// ToLogger returns a stdlib log.Logger (that doesn't actually write to anything).
|
|
func (l *NullLogger) ToLogger(prio logPrio) (stdLibLog *log.Logger) {
|
|
|
|
stdLibLog = log.New(&nullWriter{}, "", 0)
|
|
|
|
return
|
|
}
|