-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdoc.go
43 lines (35 loc) · 1.08 KB
/
doc.go
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
31
32
33
34
35
36
37
38
39
40
41
42
43
/*
Package golog provides a simple alternative to standard log that
defines a Logger interface allowing custom logger to be used
across the application and its libraries.
To begin with, import the golog package and start using its exported
functions like:
import "github.com/bnclabs/golog"
...
log.Printf()
log.Fatalf()
Default logger will be used in the above case. To configure default
logger:
setts := map[string]interface{}{
"log.level": "info",
"log.flags": "",
"log.file": "",
"log.timeformat": timeformat,
"log.prefix": prefix,
"log.colorignore": "",
"log.colorfatal": "red",
"log.colorerror": "hired",
"log.colorwarn": "yellow",
"log.colorinfo": "",
"log.colorverbose": "",
"log.colordebug": "",
"log.colortrace": "",
}
log.SetLogger(nil, setts)
Default logger will be configured to "info" level. Refer
Defaultsettings() for description on each settings parameter.
To configure a custom logger:
log.Setlogger(customlogger, nil)
Note that `customlogger` should implement the Logger interface.
*/
package log