mirror of
https://github.com/pushbits/server.git
synced 2025-05-02 11:46:17 +02:00
25 lines
451 B
Go
25 lines
451 B
Go
// Package log provides functionality to configure the logger.
|
|
package log
|
|
|
|
import (
|
|
"os"
|
|
|
|
log "github.com/sirupsen/logrus"
|
|
)
|
|
|
|
// L is the global logger instance for PushBits.
|
|
var L *log.Logger
|
|
|
|
func init() {
|
|
L = log.New()
|
|
L.SetOutput(os.Stderr)
|
|
L.SetLevel(log.InfoLevel)
|
|
L.SetFormatter(&log.TextFormatter{
|
|
DisableTimestamp: true,
|
|
})
|
|
}
|
|
|
|
// SetDebug sets the logger to output debug information.
|
|
func SetDebug() {
|
|
L.SetLevel(log.DebugLevel)
|
|
}
|