Init configuration from file #3
3
log.go
3
log.go
@ -280,7 +280,8 @@ func init() {
|
||||
}
|
||||
|
||||
// create a default log to write to console
|
||||
NewLogger(1000, "std", "console", `{"flags":"shortfile,shortfuncname,level,microseconds,date,shortfile", "stacktraceLevel":"error"}`)
|
||||
NewLogger(1000, "std", "console", fmt.Sprintf(`{"flags":%d, "stacktraceLevel":"error"}`,
|
||||
|
||||
FlagsFromString("shortfile,shortfuncname,level,microseconds,date,shortfile")))
|
||||
hasDefaultLogger = true
|
||||
if err != nil {
|
||||
Error("Error reading provided config file: %s Err: %v", configFile, err)
|
||||
|
Reference in New Issue
Block a user
If config load successfully, the default logger should be disabled I think.
Take a look at line 278:
if there's no error during configuration from the provided configuration then
init()
returns here.OK. Just found we need add reactions on code comments.