pushbits/internal/log/log.go
2023-04-01 20:00:58 +02:00

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)
}