refactor: standardize code comments

This commit is contained in:
tinkle-community
2025-12-08 01:40:48 +08:00
parent 0636ced476
commit a12c0ae8c9
103 changed files with 5466 additions and 5468 deletions

View File

@@ -1,8 +1,8 @@
package mcp
// Logger 日志接口(抽象依赖)
// 使用 Printf 风格的方法名,方便集成 logruszap 等主流日志库
// 默认使用全局 logger 包(见 mcp/config.go
// Logger interface (abstract dependency)
// Uses Printf-style method names for easy integration with mainstream logging libraries like logrus, zap, etc.
// Default uses global logger package (see mcp/config.go)
type Logger interface {
Debugf(format string, args ...any)
Infof(format string, args ...any)
@@ -10,7 +10,7 @@ type Logger interface {
Errorf(format string, args ...any)
}
// noopLogger 空日志实现(测试时使用)
// noopLogger no-op logger implementation (used in tests)
type noopLogger struct{}
func (l *noopLogger) Debugf(format string, args ...any) {}
@@ -18,7 +18,7 @@ func (l *noopLogger) Infof(format string, args ...any) {}
func (l *noopLogger) Warnf(format string, args ...any) {}
func (l *noopLogger) Errorf(format string, args ...any) {}
// NewNoopLogger 创建空日志器(测试使用)
// NewNoopLogger creates no-op logger (for testing)
func NewNoopLogger() Logger {
return &noopLogger{}
}