34 lines
688 B
Go
34 lines
688 B
Go
package appconfig
|
|
|
|
import "fmt"
|
|
|
|
type logger interface {
|
|
Output(int, string) error
|
|
}
|
|
|
|
type ilogger interface {
|
|
logger
|
|
Print(...interface{})
|
|
Printf(string, ...interface{})
|
|
Println(...interface{})
|
|
}
|
|
|
|
type internalLog struct {
|
|
logger
|
|
}
|
|
|
|
// Println replicates the behaviour of the standard logger.
|
|
func (t internalLog) Println(v ...interface{}) {
|
|
t.Output(2, fmt.Sprintln(v...))
|
|
}
|
|
|
|
// Printf replicates the behaviour of the standard logger.
|
|
func (t internalLog) Printf(format string, v ...interface{}) {
|
|
t.Output(2, fmt.Sprintf(format, v...))
|
|
}
|
|
|
|
// Print replicates the behaviour of the standard logger.
|
|
func (t internalLog) Print(v ...interface{}) {
|
|
t.Output(2, fmt.Sprint(v...))
|
|
}
|