-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy pathlog.go
42 lines (32 loc) · 765 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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package main
import "fmt"
import "github.com/kovetskiy/lorg"
import "github.com/kovetskiy/spinner-go"
import "os"
func getLogger() *lorg.Log {
logger := lorg.NewLog()
logger.SetFormat(lorg.NewFormat("${level:[%s]:left:true} %s"))
return logger
}
func fatalf(format string, values ...interface{}) {
if spinner.IsActive() {
spinner.Stop()
}
fmt.Fprintf(os.Stderr, format+"\n", values...)
os.Exit(1)
}
func fatalln(value interface{}) {
fatalf("%s", value)
}
func debugf(format string, values ...interface{}) {
logger.Debugf(format, values...)
}
func tracef(format string, values ...interface{}) {
logger.Tracef(format, values...)
}
func debugln(value interface{}) {
debugf("%s", value)
}
func traceln(value interface{}) {
tracef("%s", value)
}