添加业务模式
This commit is contained in:
+18
@@ -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...)
|
||||
|
||||
Reference in New Issue
Block a user