diff --git a/pkg/unilogger/global.go b/pkg/unilogger/global.go index eeaf7fc9..37a8acb6 100644 --- a/pkg/unilogger/global.go +++ b/pkg/unilogger/global.go @@ -1,3 +1,4 @@ +// global logger is deprecated package unilogger import ( diff --git a/pkg/unilogger/logger.go b/pkg/unilogger/logger.go index 32ce454d..258c4bff 100644 --- a/pkg/unilogger/logger.go +++ b/pkg/unilogger/logger.go @@ -149,6 +149,7 @@ func (l *Logger) Trace(msg string, args ...any) { l.Log(ctx, LevelTrace.Level(), msg, args...) } +// deprecated func (l *Logger) Tracef(format string, args ...any) { ctx := logContext.SetCustomKeyContext(context.Background()) ctx = logContext.SetStackTraceContext(ctx, getStack()) @@ -156,26 +157,31 @@ func (l *Logger) Tracef(format string, args ...any) { l.Log(ctx, LevelTrace.Level(), fmt.Sprintf(format, args...)) } +// deprecated func (l *Logger) Logf(ctx context.Context, level Level, format string, args ...any) { ctx = logContext.SetCustomKeyContext(ctx) l.Log(ctx, level.Level(), fmt.Sprintf(format, args...)) } +// deprecated func (l *Logger) Debugf(format string, args ...any) { ctx := logContext.SetCustomKeyContext(context.Background()) l.Log(ctx, LevelDebug.Level(), fmt.Sprintf(format, args...)) } +// deprecated func (l *Logger) Infof(format string, args ...any) { ctx := logContext.SetCustomKeyContext(context.Background()) l.Log(ctx, LevelInfo.Level(), fmt.Sprintf(format, args...)) } +// deprecated func (l *Logger) Warnf(format string, args ...any) { ctx := logContext.SetCustomKeyContext(context.Background()) l.Log(ctx, LevelWarn.Level(), fmt.Sprintf(format, args...)) } +// deprecated func (l *Logger) Errorf(format string, args ...any) { ctx := logContext.SetCustomKeyContext(context.Background()) l.Log(ctx, LevelError.Level(), fmt.Sprintf(format, args...)) @@ -190,6 +196,7 @@ func (l *Logger) Fatal(msg string, args ...any) { os.Exit(1) } +// deprecated func (l *Logger) Fatalf(format string, args ...any) { ctx := logContext.SetCustomKeyContext(context.Background()) ctx = logContext.SetStackTraceContext(ctx, getStack())