improve package internal/intlog

This commit is contained in:
jflyfox
2021-03-01 17:39:13 +08:00
parent 04e42d2175
commit d0f649b328

View File

@ -95,7 +95,8 @@ func (w *Watcher) addWithCallbackFunc(name, path string, callbackFunc func(event
if err := w.watcher.Add(path); err != nil {
intlog.Error(err)
} else {
intlog.Printf("watcher adds monitor for: %s", path)
// It uses `Errorf` as it needs trace stack information here.
intlog.Errorf("watcher adds monitor for: %s", path)
}
// Add the callback to global callback map.
callbackIdMap.Set(callback.Id, callback)