20 lines
428 B
Go
20 lines
428 B
Go
|
package models
|
||
|
|
||
|
import (
|
||
|
"github.com/op/go-logging"
|
||
|
"os"
|
||
|
)
|
||
|
|
||
|
var Log = logging.MustGetLogger("vikunja")
|
||
|
|
||
|
var format = logging.MustStringFormatter(
|
||
|
`%{color}%{time:15:04:05.000} %{shortfunc} ▶ %{level:.4s} %{id:03x}%{color:reset} %{message}`,
|
||
|
)
|
||
|
|
||
|
func InitLogger() {
|
||
|
backend := logging.NewLogBackend(os.Stderr, "", 0)
|
||
|
backendFormatter := logging.NewBackendFormatter(backend, format)
|
||
|
logging.SetBackend(backendFormatter)
|
||
|
}
|
||
|
|