mirror of
https://codeberg.org/superseriousbusiness/gotosocial.git
synced 2024-12-30 04:48:18 +03:00
28 lines
501 B
Go
28 lines
501 B
Go
|
package internal
|
||
|
|
||
|
import (
|
||
|
"fmt"
|
||
|
"log"
|
||
|
"os"
|
||
|
)
|
||
|
|
||
|
var Warn = log.New(os.Stderr, "WARN: bun: ", log.LstdFlags)
|
||
|
|
||
|
var Deprecated = log.New(os.Stderr, "DEPRECATED: bun: ", log.LstdFlags)
|
||
|
|
||
|
type Logging interface {
|
||
|
Printf(format string, v ...interface{})
|
||
|
}
|
||
|
|
||
|
type logger struct {
|
||
|
log *log.Logger
|
||
|
}
|
||
|
|
||
|
func (l *logger) Printf(format string, v ...interface{}) {
|
||
|
_ = l.log.Output(2, fmt.Sprintf(format, v...))
|
||
|
}
|
||
|
|
||
|
var Logger Logging = &logger{
|
||
|
log: log.New(os.Stderr, "bun: ", log.LstdFlags|log.Lshortfile),
|
||
|
}
|