引入一下日志库

This commit is contained in:
Yun
2025-09-19 18:52:33 +08:00
parent 4db3cf81b7
commit e4c453baca
6 changed files with 138 additions and 21 deletions
+4 -4
View File
@@ -7,7 +7,7 @@ import (
type Logger interface {
Infof(ctx context.Context, format string, v ...any)
Warnf(ctx context.Context, format string, v ...any)
// Warnf(ctx context.Context, format string, v ...any)
Errorf(ctx context.Context, format string, v ...any)
}
@@ -21,9 +21,9 @@ func (l *defaultLogger) Infof(ctx context.Context, format string, v ...any) {
log.Printf("[INFO] "+format, v...)
}
func (l *defaultLogger) Warnf(ctx context.Context, format string, v ...any) {
log.Printf("[WARN] "+format, v...)
}
// func (l *defaultLogger) Warnf(ctx context.Context, format string, v ...any) {
// log.Printf("[WARN] "+format, v...)
// }
func (l *defaultLogger) Errorf(ctx context.Context, format string, v ...any) {
log.Printf("[ERROR] "+format, v...)