chore: import Local-Cursor v1.1.8 source snapshot
Includes the current working directory changes. Historical commits and release binaries are excluded to limit Gitea storage. Source base: d7515973fbfd6dd2001fa156c483455b8081c7cb
This commit is contained in:
24
internal/bridge/logging.go
Normal file
24
internal/bridge/logging.go
Normal file
@@ -0,0 +1,24 @@
|
||||
package bridge
|
||||
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"cursor/internal/logger"
|
||||
)
|
||||
|
||||
var errServiceNotReady = errors.New("应用未初始化")
|
||||
|
||||
// logServiceCall 记录用户触发或后台调用的服务操作,不记录密钥和配置正文。
|
||||
func logServiceCall(service string, operation string, attrs ...any) {
|
||||
args := append([]any{"service", service, "operation", operation}, attrs...)
|
||||
logger.Info("service call", args...)
|
||||
}
|
||||
|
||||
// logServiceResult 统一记录服务操作结果,失败时保留原始错误。
|
||||
func logServiceResult(service string, operation string, err error) {
|
||||
if err != nil {
|
||||
logger.Error("service call failed", "service", service, "operation", operation, "error", err)
|
||||
return
|
||||
}
|
||||
logger.Info("service call completed", "service", service, "operation", operation)
|
||||
}
|
||||
Reference in New Issue
Block a user