Commit 622d6d17 authored by wei.xuan's avatar wei.xuan

feat:add log

parent 4b879147
......@@ -108,3 +108,20 @@ func SetLoggerCallerDisable() error {
log = zapLogger.Sugar()
return nil
}
func Online(logfile string) error {
var err error
if len(logfile) == 0 {
logfile = "./std.log"
}
zapLoggerConfig.OutputPaths = []string{logfile}
zapLoggerConfig.Development = false
zapLoggerConfig.DisableCaller = true
zapLoggerConfig.DisableStacktrace = true
zapLogger, err = zapLoggerConfig.Build()
if err != nil {
return err
}
log = zapLogger.Sugar()
return 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