添加业务模式

This commit is contained in:
Yun
2025-08-23 19:17:40 +08:00
parent 124d75a205
commit 75efec48bf
3 changed files with 31 additions and 0 deletions
+18
View File
@@ -129,6 +129,24 @@ func (l *Logger) Errorf(ctx context.Context, format string, v ...any) {
l.logger(ctx, "error", s)
}
func (l *Logger) Debug(ctx context.Context, v ...any) {
l.logger(ctx, "debug", v...)
}
func (l *Logger) Debugf(ctx context.Context, format string, v ...any) {
s := fmt.Sprintf(format, v...)
l.logger(ctx, "debug", s)
}
func (l *Logger) Warn(ctx context.Context, v ...any) {
l.logger(ctx, "warn", v...)
}
func (l *Logger) Warnf(ctx context.Context, format string, v ...any) {
s := fmt.Sprintf(format, v...)
l.logger(ctx, "warn", s)
}
// 添加固定的内容
// func (l *Logger) ContextWithFields(ctx context.Context, v ...any) {
// l.logger(ctx, "add", v...)