2022-03-13 13:29:31 -04:00
|
|
|
package logging
|
|
|
|
|
2024-06-19 18:57:26 -04:00
|
|
|
import (
|
|
|
|
`log`
|
|
|
|
)
|
|
|
|
|
2022-03-13 13:29:31 -04:00
|
|
|
// 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
|
|
|
|
}
|
|
|
|
|
2022-09-07 06:03:28 -04:00
|
|
|
// GetDebug returns the debug status of this NullLogger. It will always return true. 🙃
|
|
|
|
func (n *NullLogger) GetDebug() (d bool) {
|
|
|
|
|
|
|
|
d = true
|
|
|
|
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-03-13 13:29:31 -04:00
|
|
|
// 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
|
|
|
|
}
|
2024-06-19 18:57:26 -04:00
|
|
|
|
|
|
|
// 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
|
|
|
|
}
|