From fa718f733ce9c0e06553f05db9945456fda78fa6 Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Sat, 28 Jan 2023 10:24:51 +0800 Subject: [PATCH] =?UTF-8?q?:art:=20=E8=B0=83=E6=95=B4=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E8=BE=93=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kernel/model/file.go | 2 +- kernel/model/transaction.go | 28 ++++++++++++++-------------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/kernel/model/file.go b/kernel/model/file.go index 203c28751..07edca45c 100644 --- a/kernel/model/file.go +++ b/kernel/model/file.go @@ -1420,7 +1420,7 @@ func createDoc(boxID, p, title, dom string) (tree *parse.Tree, err error) { parentID := path.Base(folder) parentTree, loadErr := loadTreeByBlockID(parentID) if nil != loadErr { - logging.LogErrorf("get parent tree [id=%s] failed", parentID) + logging.LogErrorf("get parent tree [%s] failed", parentID) err = ErrBlockNotFound return } diff --git a/kernel/model/transaction.go b/kernel/model/transaction.go index a97f0e629..9f84a27a7 100644 --- a/kernel/model/transaction.go +++ b/kernel/model/transaction.go @@ -235,7 +235,7 @@ func (tx *Transaction) doMove(operation *Operation) (ret *TxErr) { id := operation.ID srcTree, err := tx.loadTree(id) if nil != err { - logging.LogErrorf("load tree [id=%s] failed: %s", id, err) + logging.LogErrorf("load tree [%s] failed: %s", id, err) return &TxErr{code: TxErrCodeBlockNotFound, id: id} } @@ -265,7 +265,7 @@ func (tx *Transaction) doMove(operation *Operation) (ret *TxErr) { var targetTree *parse.Tree targetTree, err = tx.loadTree(targetPreviousID) if nil != err { - logging.LogErrorf("load tree [id=%s] failed: %s", targetPreviousID, err) + logging.LogErrorf("load tree [%s] failed: %s", targetPreviousID, err) return &TxErr{code: TxErrCodeBlockNotFound, id: targetPreviousID} } isSameTree := srcTree.ID == targetTree.ID @@ -318,7 +318,7 @@ func (tx *Transaction) doMove(operation *Operation) (ret *TxErr) { targetTree, err := tx.loadTree(targetParentID) if nil != err { - logging.LogErrorf("load tree [id=%s] failed: %s", targetParentID, err) + logging.LogErrorf("load tree [%s] failed: %s", targetParentID, err) return &TxErr{code: TxErrCodeBlockNotFound, id: targetParentID} } isSameTree := srcTree.ID == targetTree.ID @@ -404,7 +404,7 @@ func (tx *Transaction) doPrependInsert(operation *Operation) (ret *TxErr) { var err error block := treenode.GetBlockTree(operation.ParentID) if nil == block { - msg := fmt.Sprintf("not found parent block [id=%s]", operation.ParentID) + msg := fmt.Sprintf("not found parent block [%s]", operation.ParentID) logging.LogErrorf(msg) return &TxErr{code: TxErrCodeBlockNotFound, id: operation.ParentID} } @@ -413,7 +413,7 @@ func (tx *Transaction) doPrependInsert(operation *Operation) (ret *TxErr) { return &TxErr{code: TxErrCodeUnableAccessFile, msg: err.Error(), id: block.ID} } if nil != err { - msg := fmt.Sprintf("load tree [id=%s] failed: %s", block.ID, err) + msg := fmt.Sprintf("load tree [%s] failed: %s", block.ID, err) logging.LogErrorf(msg) return &TxErr{code: TxErrCodeBlockNotFound, id: block.ID} } @@ -492,7 +492,7 @@ func (tx *Transaction) doAppendInsert(operation *Operation) (ret *TxErr) { var err error block := treenode.GetBlockTree(operation.ParentID) if nil == block { - msg := fmt.Sprintf("not found parent block [id=%s]", operation.ParentID) + msg := fmt.Sprintf("not found parent block [%s]", operation.ParentID) logging.LogErrorf(msg) return &TxErr{code: TxErrCodeBlockNotFound, id: operation.ParentID} } @@ -501,7 +501,7 @@ func (tx *Transaction) doAppendInsert(operation *Operation) (ret *TxErr) { return &TxErr{code: TxErrCodeUnableAccessFile, msg: err.Error(), id: block.ID} } if nil != err { - msg := fmt.Sprintf("load tree [id=%s] failed: %s", block.ID, err) + msg := fmt.Sprintf("load tree [%s] failed: %s", block.ID, err) logging.LogErrorf(msg) return &TxErr{code: TxErrCodeBlockNotFound, id: block.ID} } @@ -569,7 +569,7 @@ func (tx *Transaction) doAppend(operation *Operation) (ret *TxErr) { id := operation.ID srcTree, err := tx.loadTree(id) if nil != err { - logging.LogErrorf("load tree [id=%s] failed: %s", id, err) + logging.LogErrorf("load tree [%s] failed: %s", id, err) return &TxErr{code: TxErrCodeBlockNotFound, id: id} } @@ -607,7 +607,7 @@ func (tx *Transaction) doAppend(operation *Operation) (ret *TxErr) { targetTree, err := tx.loadTree(targetRootID) if nil != err { - logging.LogErrorf("load tree [id=%s] failed: %s", targetRootID, err) + logging.LogErrorf("load tree [%s] failed: %s", targetRootID, err) return &TxErr{code: TxErrCodeBlockNotFound, id: targetRootID} } isSameTree := srcTree.ID == targetTree.ID @@ -663,7 +663,7 @@ func (tx *Transaction) doDelete(operation *Operation) (ret *TxErr) { } if nil != err { - msg := fmt.Sprintf("load tree [id=%s] failed: %s", id, err) + msg := fmt.Sprintf("load tree [%s] failed: %s", id, err) logging.LogErrorf(msg) return &TxErr{code: TxErrCodeBlockNotFound, id: id} } @@ -704,7 +704,7 @@ func (tx *Transaction) doInsert(operation *Operation) (ret *TxErr) { } } if nil == block { - msg := fmt.Sprintf("not found next block [id=%s]", operation.NextID) + msg := fmt.Sprintf("not found next block [%s]", operation.NextID) logging.LogErrorf(msg) return &TxErr{code: TxErrCodeBlockNotFound, id: operation.NextID} } @@ -714,7 +714,7 @@ func (tx *Transaction) doInsert(operation *Operation) (ret *TxErr) { return &TxErr{code: TxErrCodeUnableAccessFile, msg: err.Error(), id: block.ID} } if nil != err { - msg := fmt.Sprintf("load tree [id=%s] failed: %s", block.ID, err) + msg := fmt.Sprintf("load tree [%s] failed: %s", block.ID, err) logging.LogErrorf(msg) return &TxErr{code: TxErrCodeBlockNotFound, id: block.ID} } @@ -860,7 +860,7 @@ func (tx *Transaction) doUpdate(operation *Operation) (ret *TxErr) { return &TxErr{code: TxErrCodeUnableAccessFile, msg: err.Error(), id: id} } if nil != err { - logging.LogErrorf("load tree [id=%s] failed: %s", id, err) + logging.LogErrorf("load tree [%s] failed: %s", id, err) return &TxErr{code: TxErrCodeBlockNotFound, id: id} } @@ -948,7 +948,7 @@ func (tx *Transaction) setAttrs(operation *Operation) (ret *TxErr) { id := operation.ID tree, err := tx.loadTree(id) if nil != err { - logging.LogErrorf("load tree [id=%s] failed: %s", id, err) + logging.LogErrorf("load tree [%s] failed: %s", id, err) return &TxErr{code: TxErrCodeBlockNotFound, id: id} }