forked from hekmon/hllogger
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstd.go
151 lines (121 loc) · 4.31 KB
/
std.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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
package hllogger
import (
"io"
"os"
)
// std logger is a *Logger that outputs to stdout at info level by default.
// You can configure it with Set* methods.
var std = New(os.Stdout, LevelInfo)
// Default returns the default standard logger used by the package-level output functions.
func Default() *Logger {
return std
}
// SetOutput sets the output destination for the default standard logger.
func SetOutput(w io.Writer) {
std.SetOutput(w)
}
// SetLogLevel sets the log level for the default standard logger.
// This function is not thread safe, do not set log level if you are printing logs already.
func SetLogLevel(l LogLevel) {
std.SetLogLevel(l)
}
// SetFlags sets the logger flags for the default standard logger.
func SetFlags(flags int) {
std.SetFlags(flags)
}
// Debug logs a message at the Debug level with the default standard logger.
func Debug(message string) {
std.Debug(message)
}
// Debugf logs a formatted message at the Debug level with the default standard logger.
func Debugf(format string, v ...interface{}) {
std.Debugf(format, v...)
}
// IsDebugShown returns true if the Debug level is in use on the default standard logger.
func IsDebugShown() bool {
return std.IsDebugShown()
}
// Info logs a message at the Info level with the default standard logger.
func Info(message string) {
std.Info(message)
}
// Infof logs a formatted message at the Info level with the default standard logger.
func Infof(format string, v ...interface{}) {
std.Infof(format, v...)
}
// IsInfoShown returns true if the Info level is in use on the default standard logger.
func IsInfoShown() bool {
return std.IsInfoShown()
}
// Notice logs a message at the Notice level with the default standard logger.
func Notice(message string) {
std.Notice(message)
}
// Noticef logs a formatted message at the Notice level with the default standard logger.
func Noticef(format string, v ...interface{}) {
std.Noticef(format, v...)
}
// IsNoticeShown returns true if the Notice level is in use on the default standard logger.
func IsNoticeShown() bool {
return std.IsNoticeShown()
}
// Warning logs a message at the Warning level with the default standard logger.
func Warning(message string) {
std.Warning(message)
}
// Warningf logs a formatted message at the Warning level with the default standard logger.
func Warningf(format string, v ...interface{}) {
std.Warningf(format, v...)
}
// IsWarningShown returns true if the Warning level is in use on the default standard logger.
func IsWarningShown() bool {
return std.IsWarningShown()
}
// Error logs a message at the Error level with the default standard logger.
func Error(message string) {
std.Error(message)
}
// Errorf logs a formatted message at the Error level with the default standard logger.
func Errorf(format string, v ...interface{}) {
std.Errorf(format, v...)
}
// IsErrorShown returns true if the Error level is in use on the default standard logger.
func IsErrorShown() bool {
return std.IsErrorShown()
}
// Critical logs a message at the Critical level with the default standard logger.
func Critical(message string) {
std.Critical(message)
}
// Criticalf logs a formatted message at the Critical level with the default standard logger.
func Criticalf(format string, v ...interface{}) {
std.Errorf(format, v...)
}
// IsCriticalShown returns true if the Critical level is in use on the default standard logger.
func IsCriticalShown() bool {
return std.IsCriticalShown()
}
// Alert logs a message at the Alert level with the default standard logger.
func Alert(message string) {
std.Alert(message)
}
// Alertf logs a formatted message at the Alert level with the default standard logger.
func Alertf(format string, v ...interface{}) {
std.Alertf(format, v...)
}
// IsAlertShown returns true if the Alert level is in use on the default standard logger.
func IsAlertShown() bool {
return std.IsAlertShown()
}
// Emergency logs a message at the Emergency level with the default standard logger.
func Emergency(message string) {
std.Emergency(message)
}
// Emergencyf logs a formatted message at the Emergency level with the default standard logger.
func Emergencyf(format string, v ...interface{}) {
std.Emergencyf(format, v...)
}
// IsEmergencyShown returns true if the Emergency level is in use on the default standard logger.
func IsEmergencyShown() bool {
return std.IsEmergencyShown()
}