mirror of
https://github.com/pushbits/server.git
synced 2025-08-06 10:08:55 +02:00
Use logrus for logging
This commit is contained in:
parent
c96baf40a5
commit
f839f248b9
19 changed files with 192 additions and 87 deletions
22
internal/log/log.go
Normal file
22
internal/log/log.go
Normal file
|
@ -0,0 +1,22 @@
|
|||
package log
|
||||
|
||||
import (
|
||||
"os"
|
||||
|
||||
log "github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
var L *log.Logger
|
||||
|
||||
func init() {
|
||||
L = log.New()
|
||||
L.SetOutput(os.Stderr)
|
||||
L.SetLevel(log.InfoLevel)
|
||||
L.SetFormatter(&log.TextFormatter{
|
||||
DisableTimestamp: true,
|
||||
})
|
||||
}
|
||||
|
||||
func SetDebug() {
|
||||
L.SetLevel(log.DebugLevel)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue