forked from cenkalti/log
-
Notifications
You must be signed in to change notification settings - Fork 0
/
log.go
60 lines (53 loc) · 2.71 KB
/
log.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
// Package logging is an alternative to log package in standard library.
package log
import "os"
type Level int
// Logging levels.
const (
CRITICAL Level = iota
ERROR
WARNING
NOTICE
INFO
DEBUG
)
var (
DefaultLogger Logger = NewLogger(procName)
DefaultLevel Level = INFO
DefaultHandler Handler = NewFileHandler(os.Stderr)
DefaultFormatter Formatter = defaultFormatter{}
)
///////////////////
// //
// DefaultLogger //
// //
///////////////////
// SetLevel changes the level of DefaultLogger and DefaultHandler.
func SetLevel(l Level) {
DefaultLogger.SetLevel(l)
DefaultHandler.SetLevel(l)
}
func Fatal(args ...interface{}) { DefaultLogger.Fatal(args...) }
func Fatalf(format string, args ...interface{}) { DefaultLogger.Fatalf(format, args...) }
func Fatalln(args ...interface{}) { DefaultLogger.Fatalln(args...) }
func Panic(args ...interface{}) { DefaultLogger.Panic(args...) }
func Panicf(format string, args ...interface{}) { DefaultLogger.Panicf(format, args...) }
func Panicln(args ...interface{}) { DefaultLogger.Panicln(args...) }
func Critical(args ...interface{}) { DefaultLogger.Critical(args...) }
func Criticalf(format string, args ...interface{}) { DefaultLogger.Criticalf(format, args...) }
func Criticalln(args ...interface{}) { DefaultLogger.Criticalln(args...) }
func Error(args ...interface{}) { DefaultLogger.Error(args...) }
func Errorf(format string, args ...interface{}) { DefaultLogger.Errorf(format, args...) }
func Errorln(args ...interface{}) { DefaultLogger.Errorln(args...) }
func Warning(args ...interface{}) { DefaultLogger.Warning(args...) }
func Warningf(format string, args ...interface{}) { DefaultLogger.Warningf(format, args...) }
func Warningln(args ...interface{}) { DefaultLogger.Warningln(args...) }
func Notice(args ...interface{}) { DefaultLogger.Notice(args...) }
func Noticef(format string, args ...interface{}) { DefaultLogger.Noticef(format, args...) }
func Noticeln(args ...interface{}) { DefaultLogger.Noticeln(args...) }
func Info(args ...interface{}) { DefaultLogger.Info(args...) }
func Infof(format string, args ...interface{}) { DefaultLogger.Infof(format, args...) }
func Infoln(args ...interface{}) { DefaultLogger.Infoln(args...) }
func Debug(args ...interface{}) { DefaultLogger.Debug(args...) }
func Debugf(format string, args ...interface{}) { DefaultLogger.Debugf(format, args...) }
func Debugln(args ...interface{}) { DefaultLogger.Debugln(args...) }