improve package internal/intlog

This commit is contained in:
jflyfox 2021-03-01 17:15:18 +08:00
parent ffc88eaaa7
commit 04e42d2175
3 changed files with 8 additions and 13 deletions

View File

@ -37,11 +37,6 @@ func SetEnabled(enabled bool) {
}
}
// IsEnabled checks and returns whether current process is in GF development.
func IsEnabled() bool {
return isGFDebug
}
// Print prints `v` with newline using fmt.Println.
// The parameter `v` can be multiple variables.
func Print(v ...interface{}) {

View File

@ -409,7 +409,7 @@ func (c *Config) getJson(file ...string) *gjson.Json {
}
}
return j
} else {
}
if errorPrint() {
if filePath != "" {
glog.Criticalf(`[gcfg] Load config file "%s" failed: %s`, filePath, err.Error())
@ -417,7 +417,6 @@ func (c *Config) getJson(file ...string) *gjson.Json {
glog.Criticalf(`[gcfg] Load configuration failed: %s`, err.Error())
}
}
}
return nil
})
if r != nil {

View File

@ -47,7 +47,8 @@ func (w *Watcher) AddOnce(name, path string, callbackFunc func(event *Event), re
if err := w.watcher.Add(subPath); err != nil {
intlog.Error(err)
} else {
intlog.Printf("watcher adds monitor for: %s", subPath)
// It uses `Errorf` as it needs trace stack information here.
intlog.Errorf("watcher adds monitor for: %s", subPath)
}
}
}