fix(flashnode): avoid unnecessary audit log printing #23112585

Signed-off-by: clinx <chenlin1@oppo.com>
This commit is contained in:
clinx 2025-03-07 17:11:04 +08:00 committed by zhumingze1108
parent e9b9b9250c
commit 41ad2fdc7d

View File

@ -357,9 +357,11 @@ func (cb *CacheBlock) initFilePath(isLoad bool) (err error) {
cb.notifyReady()
}
_, err = os.Stat(cb.filePath)
msg := fmt.Sprintf("init cache block(%s) to local: err %v", cb.filePath, err)
log.LogDebugf("%v", msg)
auditlog.LogFlashNodeOp("BlockInit", msg, err)
if !isLoad && (log.EnableDebug() || err != nil) {
msg := fmt.Sprintf("init cache block(%s) to local: err %v", cb.filePath, err)
log.LogDebugf("%v", msg)
auditlog.LogFlashNodeOp("BlockInit", msg, err)
}
return
}