mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-19 05:28:07 +01:00
♻️ 日志组件单独抽取项目 https://github.com/siyuan-note/siyuan/issues/5439
This commit is contained in:
parent
c8ea858976
commit
505b973c2d
70 changed files with 671 additions and 942 deletions
|
|
@ -23,6 +23,7 @@ import (
|
|||
"time"
|
||||
|
||||
"github.com/fsnotify/fsnotify"
|
||||
"github.com/siyuan-note/logging"
|
||||
"github.com/siyuan-note/siyuan/kernel/cache"
|
||||
"github.com/siyuan-note/siyuan/kernel/util"
|
||||
)
|
||||
|
|
@ -47,7 +48,7 @@ func watchAssets() {
|
|||
|
||||
var err error
|
||||
if assetsWatcher, err = fsnotify.NewWatcher(); nil != err {
|
||||
util.LogErrorf("add assets watcher for folder [%s] failed: %s", assetsDir, err)
|
||||
logging.LogErrorf("add assets watcher for folder [%s] failed: %s", assetsDir, err)
|
||||
return
|
||||
}
|
||||
|
||||
|
|
@ -72,9 +73,9 @@ func watchAssets() {
|
|||
if !ok {
|
||||
return
|
||||
}
|
||||
util.LogErrorf("watch assets failed: %s", err)
|
||||
logging.LogErrorf("watch assets failed: %s", err)
|
||||
case <-timer.C:
|
||||
//util.LogInfof("assets changed: %s", lastEvent)
|
||||
//logging.LogInfof("assets changed: %s", lastEvent)
|
||||
if lastEvent.Op&fsnotify.Write == fsnotify.Write {
|
||||
// 外部修改已有资源文件后纳入云端同步 https://github.com/siyuan-note/siyuan/issues/4694
|
||||
IncSync()
|
||||
|
|
@ -87,9 +88,9 @@ func watchAssets() {
|
|||
}()
|
||||
|
||||
if err = assetsWatcher.Add(assetsDir); err != nil {
|
||||
util.LogErrorf("add assets watcher for folder [%s] failed: %s", assetsDir, err)
|
||||
logging.LogErrorf("add assets watcher for folder [%s] failed: %s", assetsDir, err)
|
||||
}
|
||||
//util.LogInfof("added file watcher [%s]", assetsDir)
|
||||
//logging.LogInfof("added file watcher [%s]", assetsDir)
|
||||
}
|
||||
|
||||
func CloseWatchAssets() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue