...
1 package logrus
2
3 import (
4 "io"
5 "time"
6 )
7
8 var (
9
10 std = New()
11 )
12
13 func StandardLogger() *Logger {
14 return std
15 }
16
17
18 func SetOutput(out io.Writer) {
19 std.SetOutput(out)
20 }
21
22
23 func SetFormatter(formatter Formatter) {
24 std.SetFormatter(formatter)
25 }
26
27
28
29 func SetReportCaller(include bool) {
30 std.SetReportCaller(include)
31 }
32
33
34 func SetLevel(level Level) {
35 std.SetLevel(level)
36 }
37
38
39 func GetLevel() Level {
40 return std.GetLevel()
41 }
42
43
44 func IsLevelEnabled(level Level) bool {
45 return std.IsLevelEnabled(level)
46 }
47
48
49 func AddHook(hook Hook) {
50 std.AddHook(hook)
51 }
52
53
54 func WithError(err error) *Entry {
55 return std.WithField(ErrorKey, err)
56 }
57
58
59
60
61
62
63 func WithField(key string, value interface{}) *Entry {
64 return std.WithField(key, value)
65 }
66
67
68
69
70
71
72
73 func WithFields(fields Fields) *Entry {
74 return std.WithFields(fields)
75 }
76
77
78
79
80
81
82 func WithTime(t time.Time) *Entry {
83 return std.WithTime(t)
84 }
85
86
87 func Trace(args ...interface{}) {
88 std.Trace(args...)
89 }
90
91
92 func Debug(args ...interface{}) {
93 std.Debug(args...)
94 }
95
96
97 func Print(args ...interface{}) {
98 std.Print(args...)
99 }
100
101
102 func Info(args ...interface{}) {
103 std.Info(args...)
104 }
105
106
107 func Warn(args ...interface{}) {
108 std.Warn(args...)
109 }
110
111
112 func Warning(args ...interface{}) {
113 std.Warning(args...)
114 }
115
116
117 func Error(args ...interface{}) {
118 std.Error(args...)
119 }
120
121
122 func Panic(args ...interface{}) {
123 std.Panic(args...)
124 }
125
126
127 func Fatal(args ...interface{}) {
128 std.Fatal(args...)
129 }
130
131
132 func Tracef(format string, args ...interface{}) {
133 std.Tracef(format, args...)
134 }
135
136
137 func Debugf(format string, args ...interface{}) {
138 std.Debugf(format, args...)
139 }
140
141
142 func Printf(format string, args ...interface{}) {
143 std.Printf(format, args...)
144 }
145
146
147 func Infof(format string, args ...interface{}) {
148 std.Infof(format, args...)
149 }
150
151
152 func Warnf(format string, args ...interface{}) {
153 std.Warnf(format, args...)
154 }
155
156
157 func Warningf(format string, args ...interface{}) {
158 std.Warningf(format, args...)
159 }
160
161
162 func Errorf(format string, args ...interface{}) {
163 std.Errorf(format, args...)
164 }
165
166
167 func Panicf(format string, args ...interface{}) {
168 std.Panicf(format, args...)
169 }
170
171
172 func Fatalf(format string, args ...interface{}) {
173 std.Fatalf(format, args...)
174 }
175
176
177 func Traceln(args ...interface{}) {
178 std.Traceln(args...)
179 }
180
181
182 func Debugln(args ...interface{}) {
183 std.Debugln(args...)
184 }
185
186
187 func Println(args ...interface{}) {
188 std.Println(args...)
189 }
190
191
192 func Infoln(args ...interface{}) {
193 std.Infoln(args...)
194 }
195
196
197 func Warnln(args ...interface{}) {
198 std.Warnln(args...)
199 }
200
201
202 func Warningln(args ...interface{}) {
203 std.Warningln(args...)
204 }
205
206
207 func Errorln(args ...interface{}) {
208 std.Errorln(args...)
209 }
210
211
212 func Panicln(args ...interface{}) {
213 std.Panicln(args...)
214 }
215
216
217 func Fatalln(args ...interface{}) {
218 std.Fatalln(args...)
219 }
220
View as plain text