You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
559 B
Go
28 lines
559 B
Go
package main
|
|
|
|
import (
|
|
"github.com/sirupsen/logrus"
|
|
)
|
|
|
|
var log = logrus.New()
|
|
|
|
func init() {
|
|
//TODO: next add write to file
|
|
// Temporarily disable log output redirection for debugging
|
|
// if !debug {
|
|
// log.SetOutput(ioutil.Discard)
|
|
// }
|
|
log.SetFormatter(&logrus.TextFormatter{
|
|
FullTimestamp: true,
|
|
})
|
|
// Set debug level temporarily - avoid circular dependency
|
|
log.SetLevel(logrus.DebugLevel)
|
|
}
|
|
|
|
// SetLogLevel sets the log level after Storage is initialized
|
|
func SetLogLevel() {
|
|
if Storage != nil {
|
|
log.SetLevel(Storage.ServerLogLevel())
|
|
}
|
|
}
|