Files

25 lines
778 B
Go
Raw Permalink Normal View History

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)
}