-
Notifications
You must be signed in to change notification settings - Fork 0
/
log_calls.go
117 lines (101 loc) · 3.33 KB
/
log_calls.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
package log
import (
"fmt"
"os"
)
// Info writes into infologger as same as basic fmt.Print
func Info(v ...interface{}) {
if err := infoLogger.Output(2, fmt.Sprint(v...)); err != nil {
fmt.Println(err.Error())
}
}
// Infoln writes into infologger as same as basic fmt.Println
func Infoln(v ...interface{}) {
if err := infoLogger.Output(2, fmt.Sprintln(v...)); err != nil {
fmt.Println(err.Error())
}
}
// Infof writes into infologger as same as basic Outputf
func Infof(format string, v ...interface{}) {
if err := infoLogger.Output(2, fmt.Sprintf(format, v...)); err != nil {
fmt.Println(err.Error())
}
}
// Warning writes warning messages into warninglogger as same as basic log.Output
func Warning(v ...interface{}) {
if err := warningLogger.Output(2, fmt.Sprint(v...)); err != nil {
fmt.Println(err.Error())
}
}
// Warningln writes warning messages into warninglogger as same as basic log.Outputln
func Warningln(v ...interface{}) {
if err := warningLogger.Output(2, fmt.Sprintln(v...)); err != nil {
fmt.Println(err.Error())
}
}
// Warningf writes warning messages into warninglogger as same as basic log.Outputf
func Warningf(format string, v ...interface{}) {
if err := warningLogger.Output(2, fmt.Sprintf(format, v...)); err != nil {
fmt.Println(err.Error())
}
}
// Error writes error messages into errorlogger as same as basic log.Error
func Error(v ...interface{}) {
if err := errorLogger.Output(2, fmt.Sprint(v...)); err != nil {
fmt.Println(err.Error())
}
}
// Errorln writes error messages into errorlogger as same as basic log.Errorln
func Errorln(v ...interface{}) {
if err := errorLogger.Output(2, fmt.Sprintln(v...)); err != nil {
fmt.Println(err.Error())
}
}
// Errorf writes error messages into errorlogger as same as basic log.Errorf
func Errorf(format string, v ...interface{}) {
if err := errorLogger.Output(2, fmt.Sprintf(format, v...)); err != nil {
fmt.Println(err.Error())
}
}
// Fatal writes fatal error messages into errorlogger and exit as same as basic log.Fatal
func Fatal(v ...interface{}) {
if err := fatalLogger.Output(2, fmt.Sprint(v...)); err != nil {
fmt.Println(err.Error())
}
os.Exit(1)
}
// Fatalln writes fatal error messages into errorlogger and exit as same as basic log.Fatalln
func Fatalln(v ...interface{}) {
if err := fatalLogger.Output(2, fmt.Sprintln(v...)); err != nil {
fmt.Println(err.Error())
}
os.Exit(1)
}
// Fatalf writes fatal error messages into errorlogger and exit as same as basic log.Fataf
func Fatalf(format string, v ...interface{}) {
if err := fatalLogger.Output(2, fmt.Sprintf(format, v...)); err != nil {
fmt.Println(err.Error())
}
os.Exit(1)
}
// Panic writes panic error messages into errorlogger and exit as same as basic log.Panic
func Panic(v ...interface{}) {
if err := panicLogger.Output(2, fmt.Sprint(v...)); err != nil {
fmt.Println(err.Error())
}
os.Exit(1)
}
// Panicln writes Panic error messages into errorlogger and exit as same as basic log.Panicln
func Panicln(v ...interface{}) {
if err := panicLogger.Output(2, fmt.Sprintln(v...)); err != nil {
fmt.Println(err.Error())
}
os.Exit(1)
}
// Panicf writes Panic error messages into errorlogger and exit as same as basic log.Panicf
func Panicf(format string, v ...interface{}) {
if err := panicLogger.Output(2, fmt.Sprintf(format, v...)); err != nil {
fmt.Println(err.Error())
}
os.Exit(1)
}