mirror of
https://gitee.com/johng/gf.git
synced 2024-12-02 04:07:47 +08:00
improve package internal/intlog
This commit is contained in:
parent
ffc88eaaa7
commit
04e42d2175
@ -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.
|
// Print prints `v` with newline using fmt.Println.
|
||||||
// The parameter `v` can be multiple variables.
|
// The parameter `v` can be multiple variables.
|
||||||
func Print(v ...interface{}) {
|
func Print(v ...interface{}) {
|
||||||
|
@ -409,7 +409,7 @@ func (c *Config) getJson(file ...string) *gjson.Json {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return j
|
return j
|
||||||
} else {
|
}
|
||||||
if errorPrint() {
|
if errorPrint() {
|
||||||
if filePath != "" {
|
if filePath != "" {
|
||||||
glog.Criticalf(`[gcfg] Load config file "%s" failed: %s`, filePath, err.Error())
|
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())
|
glog.Criticalf(`[gcfg] Load configuration failed: %s`, err.Error())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return nil
|
return nil
|
||||||
})
|
})
|
||||||
if r != nil {
|
if r != nil {
|
||||||
|
@ -47,7 +47,8 @@ func (w *Watcher) AddOnce(name, path string, callbackFunc func(event *Event), re
|
|||||||
if err := w.watcher.Add(subPath); err != nil {
|
if err := w.watcher.Add(subPath); err != nil {
|
||||||
intlog.Error(err)
|
intlog.Error(err)
|
||||||
} else {
|
} 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)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user