/
mlog.go
31 lines (25 loc) · 970 Bytes
/
mlog.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
package mlog
import (
"github.com/mabetle/mlog/logapi"
"github.com/mabetle/mlog/wlog"
)
// SetAppenderLevel
func SetAppenderLevel(appenderName, level string, catalogs ...string) {
wlog.SetAppenderLevel(appenderName, level, catalogs...)
}
// Set all appenders catalogs level.
func SetLevel(level string, catalogs ...string) { wlog.SetLevel(level, catalogs...) }
// shortcuts for set all appenders level
func SetTraceLevel(catalogs ...string) { SetLevel("trace", catalogs...) }
func SetDebugLevel(catalogs ...string) { SetLevel("debug", catalogs...) }
func SetInfoLevel(catalogs ...string) { SetLevel("info", catalogs...) }
func SetWarnLevel(catalogs ...string) { SetLevel("warn", catalogs...) }
func SetErrorLevel(catalogs ...string) { SetLevel("error", catalogs...) }
// AddAppender
func AddAppender(appender logapi.Appender, lines []string) {
wlog.AddAppender(appender, lines)
}
// LoadConfig
func LoadConfig(location string) {
wlog.LoadConfig(location)
}