Skip to content

Commit

Permalink
Change to mosn logger api
Browse files Browse the repository at this point in the history
Signed-off-by: “huazhongming” <crazyhzm@apache.org>
  • Loading branch information
CrazyHZM committed Dec 16, 2024
1 parent c5ad5d7 commit efe5ea8
Show file tree
Hide file tree
Showing 6 changed files with 128 additions and 55 deletions.
2 changes: 2 additions & 0 deletions components/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1935,10 +1935,12 @@ k8s.io/kube-openapi v0.0.0-20201113171705-d219536bb9fd/go.mod h1:WOJ3KddDSol4tAG
k8s.io/utils v0.0.0-20201110183641-67b214c5f920/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
mosn.io/api v1.3.0 h1:QhsrbkvYnpvvrC151S0N09TdU2jDODygLVK3Y58ubgg=
mosn.io/api v1.3.0/go.mod h1:mJX2oRJkrXjLN6hY1Wwrlxj0F+RqEPOMhbf2WhZO+VY=
mosn.io/api v1.5.0/go.mod h1:mJX2oRJkrXjLN6hY1Wwrlxj0F+RqEPOMhbf2WhZO+VY=
mosn.io/mosn v1.3.0 h1:yvyCYCQnimZ9YpG5RLKbXtD9Fh8AkIySY1l2slS0iM4=
mosn.io/mosn v1.3.0/go.mod h1:FC9w5keL1uhVviytaRPT/FBo+L6XBkboyyLrV75cGw4=
mosn.io/pkg v1.3.0 h1:Oa6pwc7E98+reCrtMZD4psXekbMYrD8jM4woo2iahOI=
mosn.io/pkg v1.3.0/go.mod h1:bksEtkXis6vzQoU9Q7wwY9bWt7gfrj/l7rjRDu21Vt4=
mosn.io/pkg v1.6.0/go.mod h1:/EptiefKMKBRvrveNPYEAAgthCTSme52sLMlBXBIBm8=
mosn.io/proxy-wasm-go-host v0.2.1-0.20221123073237-4f948bf02510 h1:FHJ+U12vvS1TPdXAvwxS1CZC31K1sa9aePayGU5muEU=
mosn.io/proxy-wasm-go-host v0.2.1-0.20221123073237-4f948bf02510/go.mod h1:hC98WW5PbN+eQvnbE1F3N1eivGtlVTThfjAruULEiOM=
nhooyr.io/websocket v1.8.6 h1:s+C3xAMLwGmlI31Nyn/eAehUlZPwfYZu2JXM621Q5/k=
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ require (
k8s.io/apimachinery v0.20.2
mosn.io/api v1.5.0
mosn.io/layotto/components v0.0.0-20230712052228-c940b7f1367d
mosn.io/layotto/kit v0.0.0-00010101000000-000000000000
mosn.io/layotto/spec v0.0.0-20231023045845-48ec2bc7eab8
mosn.io/mosn v1.5.1-0.20230529091910-7d48a20e544b
mosn.io/pkg v1.5.1-0.20230525074748-e3528eae50d9
Expand Down Expand Up @@ -315,7 +316,6 @@ require (
k8s.io/client-go v0.20.0 // indirect
k8s.io/klog/v2 v2.4.0 // indirect
k8s.io/utils v0.0.0-20201110183641-67b214c5f920 // indirect
mosn.io/layotto/kit v0.0.0-00010101000000-000000000000 // indirect
nhooyr.io/websocket v1.8.7 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.0.2 // indirect
sigs.k8s.io/yaml v1.2.0 // indirect
Expand Down
5 changes: 3 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ github.com/Azure/go-autorest/logger v0.2.1/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZ
github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbtp2fGCgRFtBroKn4Dk=
github.com/Azure/go-autorest/tracing v0.6.0 h1:TYi4+3m5t6K48TGI9AUdb+IzbnSxvnvUMfuitfgcfuo=
github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU=
github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/BurntSushi/toml v1.4.0 h1:kuoIxZQy2WRRk1pttg9asf+WVv6tWQuBNVmK8+nqPr0=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/DATA-DOG/go-sqlmock v1.5.0 h1:Shsta01QNfFxHCfpW6YH2STWB0MudeXXEWMr20OEh60=
github.com/DATA-DOG/go-sqlmock v1.5.0/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM=
Expand Down Expand Up @@ -2044,8 +2044,9 @@ mosn.io/api v1.5.0 h1:Y9s6NHJx0etcqIDDP7XeoTfgceDFMBnrZphxqDsxWOE=
mosn.io/api v1.5.0/go.mod h1:mJX2oRJkrXjLN6hY1Wwrlxj0F+RqEPOMhbf2WhZO+VY=
mosn.io/mosn v1.5.1-0.20230529091910-7d48a20e544b h1:ceGtIyU+IFwcB+Vj3bHMTl+8HDcP8slhy7h5oHYpSVg=
mosn.io/mosn v1.5.1-0.20230529091910-7d48a20e544b/go.mod h1:+4vh9qHhB+hjUgy/ES13DJ85xtHQWaYAmbHB558Yzvw=
mosn.io/pkg v1.5.1-0.20230525074748-e3528eae50d9 h1:uKHek5nTFAAkqBGpQhYG2Jhz3k0aoqJiNHKCAUNYNCs=
mosn.io/pkg v1.5.1-0.20230525074748-e3528eae50d9/go.mod h1:/EptiefKMKBRvrveNPYEAAgthCTSme52sLMlBXBIBm8=
mosn.io/pkg v1.6.0 h1:R+T344PEp7CauQvXEitDJTXQ0bIeOhLwnaey9qwN4Fs=
mosn.io/pkg v1.6.0/go.mod h1:/EptiefKMKBRvrveNPYEAAgthCTSme52sLMlBXBIBm8=
nhooyr.io/websocket v1.8.6/go.mod h1:B70DZP8IakI65RVQ51MsWP/8jndNma26DVA/nFSCgW0=
nhooyr.io/websocket v1.8.7 h1:usjR2uOr/zjjkVMy0lW+PPohFok7PCow5sDjLgX4P4g=
nhooyr.io/websocket v1.8.7/go.mod h1:B70DZP8IakI65RVQ51MsWP/8jndNma26DVA/nFSCgW0=
Expand Down
14 changes: 12 additions & 2 deletions kit/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@ module mosn.io/layotto/kit

go 1.18

require github.com/sirupsen/logrus v1.9.3
require (
mosn.io/pkg v1.3.0
)

require golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8 // indirect
require (
github.com/BurntSushi/toml v1.4.0 // indirect
github.com/golang/protobuf v1.5.0 // indirect
github.com/hashicorp/go-syslog v1.0.0 // indirect
github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0 // indirect
google.golang.org/protobuf v1.26.0-rc.1 // indirect
gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect
mosn.io/api v1.3.0 // indirect
)
23 changes: 23 additions & 0 deletions kit/go.sum
Original file line number Diff line number Diff line change
@@ -1,15 +1,38 @@
github.com/BurntSushi/toml v1.4.0 h1:kuoIxZQy2WRRk1pttg9asf+WVv6tWQuBNVmK8+nqPr0=
github.com/BurntSushi/toml v1.4.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/golang/protobuf v1.5.0 h1:LUVKkCeviFUMKqHa4tXIIij/lbhnMbP7Fn5wKdKkRh4=
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/hashicorp/go-syslog v1.0.0 h1:KaodqZuhUoZereWVIYmpUgZysurB1kBLX2j0MwMrUAE=
github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0 h1:MkV+77GLUNo5oJ0jf870itWm3D0Sjh7+Za9gazKc5LQ=
github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4=
github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=
github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8 h1:0A+M6Uqn+Eje4kHMK80dtF3JCXC4ykBgQG4Fe06QRhQ=
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/protobuf v1.26.0-rc.1 h1:7QnIQpGRHE5RnLKnESfDoxm2dTapTZua5a0kS0A+VXQ=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/natefinch/lumberjack.v2 v2.0.0 h1:1Lc07Kr7qY4U2YPouBjpCLxpiyxIVoxqXgkXLknAOE8=
gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k=
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
mosn.io/api v1.3.0/go.mod h1:mJX2oRJkrXjLN6hY1Wwrlxj0F+RqEPOMhbf2WhZO+VY=
mosn.io/api v1.5.0 h1:Y9s6NHJx0etcqIDDP7XeoTfgceDFMBnrZphxqDsxWOE=
mosn.io/api v1.5.0/go.mod h1:mJX2oRJkrXjLN6hY1Wwrlxj0F+RqEPOMhbf2WhZO+VY=
mosn.io/pkg v1.3.0/go.mod h1:bksEtkXis6vzQoU9Q7wwY9bWt7gfrj/l7rjRDu21Vt4=
mosn.io/pkg v1.6.0 h1:R+T344PEp7CauQvXEitDJTXQ0bIeOhLwnaey9qwN4Fs=
mosn.io/pkg v1.6.0/go.mod h1:/EptiefKMKBRvrveNPYEAAgthCTSme52sLMlBXBIBm8=
137 changes: 87 additions & 50 deletions kit/logger/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
package logger

import (
"os"
"fmt"
"strings"
"sync"

"github.com/sirupsen/logrus"
"mosn.io/pkg/log"
)

const (
Expand All @@ -41,8 +41,6 @@ const (
// UndefinedLevel is for undefined log level.
UndefinedLevel LogLevel = "undefined"

logFieldComponent = "component"

logKeyDebug = "debug"
logKeyAccess = "access"
logKeyError = "error"
Expand Down Expand Up @@ -75,18 +73,22 @@ func SetComponentLoggerLevel(componentName string, level string) {
logLevel := toLogLevel(level)
logger, ok := loggerListeners.Load(componentName)
if !ok {
logrus.Warnf("component logger for %s not found", componentName)
}
componentLoggerListener, ok := logger.(ComponentLoggerListener)
if !ok {
logrus.Warnf("component logger for %s is not ComponentLoggerListener", componentName)
log.DefaultLogger.Warnf("component logger for %s not found", componentName)
} else {
componentLoggerListener, ok := logger.(ComponentLoggerListener)
if !ok {
log.DefaultLogger.Warnf("component logger for %s is not ComponentLoggerListener", componentName)
} else {
componentLoggerListener.OnLogLevelChanged(logLevel)
}
}
componentLoggerListener.OnLogLevelChanged(logLevel)
}

// SetDefaultLoggerLevel sets the default log output level.
func SetDefaultLoggerLevel(level string) {
defaultLoggerLevel = toLogLevel(level)
if level != "" {
defaultLoggerLevel = toLogLevel(level)
}
}

// SetDefaultLoggerFilePath sets the default log file path.
Expand All @@ -101,7 +103,7 @@ type layottoLogger struct {

logLevel LogLevel

loggers map[string]*logrus.Entry
loggers map[string]log.ErrorLogger
}

// Logger api for logging.
Expand Down Expand Up @@ -180,115 +182,150 @@ func NewLayottoLogger(name string) Logger {
ll := &layottoLogger{
name: name,
logLevel: defaultLoggerLevel,
loggers: make(map[string]*logrus.Entry),
loggers: make(map[string]log.ErrorLogger),
}

dLogger := logrus.New()
dFile, err := os.OpenFile(defaultLogFilePath+fileNameDebug, os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0666)
dMosnLogger, err := log.GetOrCreateLogger(defaultLogFilePath+fileNameDebug, nil)

dLogger := &log.SimpleErrorLog{
Logger: dMosnLogger,
Level: log.DEBUG,
}
if err != nil {
logrus.Fatalf("Failed to open log file: %v", err)
ll.loggers[logKeyDebug] = log.DefaultLogger
log.DefaultLogger.Fatalf("Failed to create mosn logger: %v", err)
} else {
dLogger.SetLogLevel(toMosnLoggerLevel(defaultLoggerLevel))
ll.loggers[logKeyDebug] = dLogger
}
dLogger.SetLevel(toLogrusLevel(defaultLoggerLevel))
dLogger.SetOutput(dFile)
ll.loggers[logKeyDebug] = dLogger.WithField(logFieldComponent, name)

aLogger := logrus.New()
aFile, err := os.OpenFile(defaultLogFilePath+fileNameAccess, os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0666)
aMosnLogger, err := log.GetOrCreateLogger(defaultLogFilePath+fileNameAccess, nil)

aLogger := &log.SimpleErrorLog{
Logger: aMosnLogger,
Level: log.INFO,
}
if err != nil {
logrus.Fatalf("Failed to open log file: %v", err)
ll.loggers[logKeyAccess] = log.DefaultLogger
log.DefaultLogger.Fatalf("Failed to create mosn logger: %v", err)
} else {
aLogger.SetLogLevel(toMosnLoggerLevel(defaultLoggerLevel))
ll.loggers[logKeyAccess] = aLogger
}
aLogger.SetLevel(toLogrusLevel(defaultLoggerLevel))
aLogger.SetOutput(aFile)
ll.loggers[logKeyAccess] = aLogger.WithField(logFieldComponent, name)

eLogger := logrus.New()
eFile, err := os.OpenFile(defaultLogFilePath+fileNameError, os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0666)
eMosnLogger, err := log.GetOrCreateLogger(defaultLogFilePath+fileNameError, nil)

eLogger := &log.SimpleErrorLog{
Logger: eMosnLogger,
Level: log.ERROR,
}
if err != nil {
logrus.Fatalf("Failed to open log file: %v", err)
ll.loggers[logKeyError] = log.DefaultLogger
log.DefaultLogger.Fatalf("Failed to create mosn logger: %v", err)
} else {
eLogger.SetLogLevel(toMosnLoggerLevel(defaultLoggerLevel))
ll.loggers[logKeyError] = eLogger
}
eLogger.SetLevel(toLogrusLevel(defaultLoggerLevel))
eLogger.SetOutput(eFile)
ll.loggers[logKeyError] = eLogger.WithField(logFieldComponent, name)

return ll
}

// Tracef logs a message at level Trace.
func (l *layottoLogger) Tracef(format string, args ...interface{}) {
l.loggers[logKeyDebug].Tracef(format, args...)
l.loggers[logKeyDebug].Tracef("[%s] %s", l.name, fmt.Sprintf(format, args...))
}

// Trace logs a message at level Trace.
func (l *layottoLogger) Trace(args ...interface{}) {
l.loggers[logKeyDebug].Trace(args...)
l.loggers[logKeyDebug].Tracef("%s", args...)
}

// Debugf logs a message at level Debug.
func (l *layottoLogger) Debugf(format string, args ...interface{}) {
l.loggers[logKeyDebug].Debugf(format, args...)
l.loggers[logKeyDebug].Debugf("[%s] %s", l.name, fmt.Sprintf(format, args...))
}

// Debug logs a message at level Debug.
func (l *layottoLogger) Debug(args ...interface{}) {
l.loggers[logKeyDebug].Debug(args...)
l.loggers[logKeyDebug].Debugf("%s", args...)
}

// Infof logs a message at level Info.
func (l *layottoLogger) Infof(format string, args ...interface{}) {
l.loggers[logKeyAccess].Infof(format, args...)
l.loggers[logKeyAccess].Infof("[%s] %s", l.name, fmt.Sprintf(format, args...))
}

// Info logs a message at level Info.
func (l *layottoLogger) Info(args ...interface{}) {
l.loggers[logKeyAccess].Info(args...)
l.loggers[logKeyAccess].Infof("%s", args...)
}

// Warnf logs a message at level Warn.
func (l *layottoLogger) Warnf(format string, args ...interface{}) {
l.loggers[logKeyAccess].Warnf(format, args...)
l.loggers[logKeyAccess].Warnf("[%s] %s", l.name, fmt.Sprintf(format, args...))
}

// Warn logs a message at level Warn.
func (l *layottoLogger) Warn(args ...interface{}) {
l.loggers[logKeyAccess].Warn(args...)
l.loggers[logKeyAccess].Warnf("%s", args...)
}

// Errorf logs a message at level Error.
func (l *layottoLogger) Errorf(format string, args ...interface{}) {
l.loggers[logKeyError].Errorf(format, args...)
l.loggers[logKeyError].Errorf("[%s] %s", l.name, fmt.Sprintf(format, args...))
}

// Error logs a message at level Error.
func (l *layottoLogger) Error(args ...interface{}) {
l.loggers[logKeyError].Error(args...)
l.loggers[logKeyError].Errorf("%s", args...)
}

// Fatalf logs a message at level Fatal.
func (l *layottoLogger) Fatalf(format string, args ...interface{}) {
l.loggers[logKeyError].Fatalf(format, args...)
l.loggers[logKeyError].Fatalf("[%s] %s", l.name, fmt.Sprintf(format, args...))
}

// Fatal logs a message at level Fatal.
func (l *layottoLogger) Fatal(args ...interface{}) {
l.loggers[logKeyError].Fatal(args...)
l.loggers[logKeyError].Fatalf("%s", args...)
}

// GetLogLevel gets the log output level.
func (l *layottoLogger) GetLogLevel() LogLevel {
return l.logLevel
}

// toLogrusLevel converts to logrus.Level.
func toLogrusLevel(lvl LogLevel) logrus.Level {
// toMosnLoggerLevel converts to logrus.Level.
func toMosnLoggerLevel(lvl LogLevel) log.Level {
// ignore error because it will never happen
l, _ := logrus.ParseLevel(string(lvl))
l, _ := parseLevel(string(lvl))
return l
}

// parseLevel takes a string level and returns the Mosn logger level constant.
func parseLevel(lvl string) (log.Level, error) {
switch strings.ToLower(lvl) {
case "fatal":
return log.FATAL, nil
case "error":
return log.ERROR, nil
case "warn", "warning":
return log.WARN, nil
case "info":
return log.INFO, nil
case "debug":
return log.DEBUG, nil
case "trace":
return log.TRACE, nil
}

var l log.Level
return l, fmt.Errorf("not a valid mosn Level: %q", lvl)
}

// SetLogLevel sets log output level.
func (l *layottoLogger) SetLogLevel(outputLevel LogLevel) {
l.logLevel = outputLevel
l.loggers[logKeyDebug].Logger.SetLevel(toLogrusLevel(outputLevel))
l.loggers[logKeyAccess].Logger.SetLevel(toLogrusLevel(outputLevel))
l.loggers[logKeyError].Logger.SetLevel(toLogrusLevel(outputLevel))
l.loggers[logKeyDebug].SetLogLevel(toMosnLoggerLevel(outputLevel))
l.loggers[logKeyAccess].SetLogLevel(toMosnLoggerLevel(outputLevel))
l.loggers[logKeyError].SetLogLevel(toMosnLoggerLevel(outputLevel))
}

0 comments on commit efe5ea8

Please sign in to comment.