Init configuration from file #3

Merged
jonasfranz merged 11 commits from zeripath/log:nicer-configuration into master 2019-06-08 10:12:22 +00:00
Showing only changes of commit eacd05affd - Show all commits

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"}`,
Outdated
Review

If config load successfully, the default logger should be disabled I think.

If config load successfully, the default logger should be disabled I think.

Take a look at line 278:

	if configFile != "" {
		err = ConfigureFromFile(configFile)
		if err == nil { 
			return // <- Line 278
		}
	}

if there's no error during configuration from the provided configuration then init() returns here.

Take a look at line 278: ```go if configFile != "" { err = ConfigureFromFile(configFile) if err == nil { return // <- Line 278 } } ``` if there's no error during configuration from the provided configuration then `init()` returns here.
Outdated
Review

OK. Just found we need add reactions on code comments.

OK. Just found we need add reactions on code comments.
FlagsFromString("shortfile,shortfuncname,level,microseconds,date,shortfile")))
hasDefaultLogger = true
if err != nil {
Error("Error reading provided config file: %s Err: %v", configFile, err)