mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 07:00:12 +01:00
🎨 Improve logging https://github.com/siyuan-note/siyuan/issues/12104
This commit is contained in:
parent
4451b0820d
commit
1c080f78f2
2 changed files with 6 additions and 1 deletions
|
|
@ -131,7 +131,7 @@ func GetBlockRefText(id string) string {
|
||||||
|
|
||||||
tree, err := LoadTreeByBlockID(id)
|
tree, err := LoadTreeByBlockID(id)
|
||||||
if nil != err {
|
if nil != err {
|
||||||
return ErrTreeNotFound.Error()
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
node := treenode.GetNodeInTree(tree, id)
|
node := treenode.GetNodeInTree(tree, id)
|
||||||
|
|
|
||||||
|
|
@ -177,6 +177,7 @@ func LoadTreeByBlockIDWithReindex(id string) (ret *parse.Tree, err error) {
|
||||||
// 仅提供给 getBlockInfo 接口使用
|
// 仅提供给 getBlockInfo 接口使用
|
||||||
|
|
||||||
if "" == id {
|
if "" == id {
|
||||||
|
logging.LogWarnf("block id is empty")
|
||||||
return nil, ErrTreeNotFound
|
return nil, ErrTreeNotFound
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -191,6 +192,7 @@ func LoadTreeByBlockIDWithReindex(id string) (ret *parse.Tree, err error) {
|
||||||
searchTreeInFilesystem(id)
|
searchTreeInFilesystem(id)
|
||||||
bt = treenode.GetBlockTree(id)
|
bt = treenode.GetBlockTree(id)
|
||||||
if nil == bt {
|
if nil == bt {
|
||||||
|
logging.LogWarnf("block tree not found [id=%s], stack: [%s]", id, logging.ShortStack())
|
||||||
return nil, ErrTreeNotFound
|
return nil, ErrTreeNotFound
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -202,6 +204,7 @@ func LoadTreeByBlockIDWithReindex(id string) (ret *parse.Tree, err error) {
|
||||||
|
|
||||||
func LoadTreeByBlockID(id string) (ret *parse.Tree, err error) {
|
func LoadTreeByBlockID(id string) (ret *parse.Tree, err error) {
|
||||||
if "" == id {
|
if "" == id {
|
||||||
|
logging.LogErrorf("block id is empty")
|
||||||
return nil, ErrTreeNotFound
|
return nil, ErrTreeNotFound
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -211,6 +214,8 @@ func LoadTreeByBlockID(id string) (ret *parse.Tree, err error) {
|
||||||
err = ErrIndexing
|
err = ErrIndexing
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
logging.LogWarnf("block tree not found [id=%s], stack: [%s]", id, logging.ShortStack())
|
||||||
return nil, ErrTreeNotFound
|
return nil, ErrTreeNotFound
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue