blob: 28105282453aab7f789e35c5776cd2c899bec220 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
package proxy
import (
"github.com/sirupsen/logrus"
"os"
)
var (
debug = os.Getenv("DEBUG_GOVPP_PROXY") != ""
log = logrus.New()
)
func init() {
log.Out = os.Stdout
if debug {
log.Level = logrus.DebugLevel
log.Debugf("govpp/proxy: debug mode enabled")
}
}
// SetLogger sets global logger to l.
func SetLogger(l *logrus.Logger) {
log = l
}
// SetLogLevel sets global logger level to lvl.
func SetLogLevel(lvl logrus.Level) {
log.Level = lvl
}
|