-
Notifications
You must be signed in to change notification settings - Fork 2
/
std.go
70 lines (56 loc) · 1.28 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
//
// Default logger:
//
// log.Info("something %s", "here")
//
package log
import "os"
var Log = New(os.Stderr, INFO, "")
// SetPrefix wrapper.
func SetPrefix(str string) {
Log.SetPrefix(str)
}
// SetLevel wrapper.
func SetLevel(level Level) {
Log.SetLevel(level)
}
// SetLevelString wrapper.
func SetLevelString(level string) {
Log.SetLevelString(level)
}
// Debug log.
func Debug(msg string, args ...interface{}) error {
return Log.Debug(msg, args...)
}
// Info log.
func Info(msg string, args ...interface{}) error {
return Log.Info(msg, args...)
}
// Notice log.
func Notice(msg string, args ...interface{}) error {
return Log.Notice(msg, args...)
}
// Warning log.
func Warning(msg string, args ...interface{}) error {
return Log.Warning(msg, args...)
}
// Error log.
func Error(msg string, args ...interface{}) error {
return Log.Error(msg, args...)
}
// Critical log.
func Critical(msg string, args ...interface{}) error {
return Log.Critical(msg, args...)
}
// Alert log.
func Alert(msg string, args ...interface{}) error {
return Log.Alert(msg, args...)
}
// Emergency log.
func Emergency(msg string, args ...interface{}) error {
return Log.Emergency(msg, args...)
}
// Check if there's an `err` and exit, useful for bootstrapping.
func Check(err error) {
Log.Check(err)
}