-
Notifications
You must be signed in to change notification settings - Fork 0
/
logging.go
52 lines (40 loc) · 1.01 KB
/
logging.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
package main
import (
"fmt"
"log"
"runtime/debug"
)
func LogTwit(msg string) {
log.Printf("twit %s\n", msg)
}
func LogInfo(msg string) {
log.Printf("INFO %s\n", msg)
}
func LogWarning(msg string) {
log.Printf("WARN %s\n", msg)
}
func LogError(msg string) {
log.Printf("ERRO %s\n", msg)
log.Println(string(debug.Stack()))
}
func LogCritical(msg string) {
log.Printf("CRIT %s\n", msg)
log.Println(string(debug.Stack()))
}
func LogTwitf(format string, a ...interface{}) {
log.Printf("twit %s\n", fmt.Sprintf(format, a...))
}
func LogInfof(format string, a ...interface{}) {
log.Printf("INFO %s\n", fmt.Sprintf(format, a...))
}
func LogWarningf(format string, a ...interface{}) {
log.Printf("WARN %s\n", fmt.Sprintf(format, a...))
}
func LogErrorf(format string, a ...interface{}) {
log.Printf("ERRO %s\n", fmt.Sprintf(format, a...))
log.Println(string(debug.Stack()))
}
func LogCriticalf(format string, a ...interface{}) {
log.Printf("CRIT %s\n", fmt.Sprintf(format, a...))
log.Println(string(debug.Stack()))
}