-
Notifications
You must be signed in to change notification settings - Fork 0
/
log.go
27 lines (21 loc) · 660 Bytes
/
log.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
package main
import (
"io"
"log"
)
var (
Trace *log.Logger // Logging the traceback of errors.
Info *log.Logger // Logging the info of errors.
Warning *log.Logger // Logging the warning may cause errors.
Error *log.Logger // Logging the errors itself.
)
func GenerateLogger(
traceLogger io.Writer,
infoLogger io.Writer,
warnLogger io.Writer,
errorLogger io.Writer) {
Trace = log.New(traceLogger, "TRACE: ", log.Ltime|log.Lshortfile)
Info = log.New(infoLogger, "INFO: ", log.Ltime|log.Lshortfile)
Warning = log.New(warnLogger, "WARNING: ", log.Ltime|log.Lshortfile)
Error = log.New(errorLogger, "ERROR: ", log.Ltime|log.Lshortfile)
}