-
Notifications
You must be signed in to change notification settings - Fork 2
/
config.go
70 lines (57 loc) · 1.87 KB
/
config.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
package log
/*
Defaultsettings used on default logger.
log.level: (default "info")
Level can be one of the following string,
"ignore", "fatal", "error", "warn", "info", "verbose",
"debug", "trace".
log.flags: (default "")
Flags can be comma seperated string values. These flags as exactly
same as the golang's standard logger.
"ldate" the date in the local time zone: 2009/01/23
"ltime" the time in the local time zone: 01:23:23
"lmicroseconds" microsecond resolution: 01:23:23.123123.
"llongfile" full file name and line number: /a/b/c/d.go:23
"lshortfile" final file name element and line number: d.go:23.
"lutc" if Ldate or Ltime is set, use UTC rather than the local time zone
"lstdflags" initial values for the standard logger ldate,ltime
log.file: (default os.Stdout)
Optional log file name to log o/p. Except Consolef all functions
will o/p to this file if supplied, else to standard output.
log.timeformat: "2006-01-02T15:04:05.999Z-07:00"
Log line timeformat.
log.prefix: [%v]
Prefix format for log-level.
log.colorfatal: "red"
Output color for fatal level.
log.colorerror: "hired"
Output color for error level.
log.colorwarn: "yellow"
Output color for warn level.
log.colorinfo: ""
Output color for info level.
log.colorverbose: "",
Output color for verbose level.
log.colordebug: "",
Output color for debug level.
log.colortrace: "",
Output color for trace level.
*/
func Defaultsettings() map[string]interface{} {
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": "",
}
return setts
}