Commit 0a02084a authored by suyanlong's avatar suyanlong

fix log

parent 9b8b4066
Pipeline #8672 canceled with stages
......@@ -50,6 +50,14 @@ func NewWithModule(name string) *logrus.Entry {
return l
}
func NewWithModuleLevel(name string, level string) *logrus.Entry {
logger := New()
logger.SetLevel(ParseLevel(level))
l := logger.WithField("module", name)
loggerCtx.loggers[name] = l
return l
}
func ParseLevel(level string) logrus.Level {
lvl, err := logrus.ParseLevel(level)
if err != nil {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment