|
@@ -1,11 +1,15 @@
|
|
|
package log
|
|
|
|
|
|
import (
|
|
|
- "context"
|
|
|
-
|
|
|
+ "github.com/sagernet/sing/common/logger"
|
|
|
"github.com/sagernet/sing/common/observable"
|
|
|
)
|
|
|
|
|
|
+type (
|
|
|
+ Logger logger.Logger
|
|
|
+ ContextLogger logger.ContextLogger
|
|
|
+)
|
|
|
+
|
|
|
type Factory interface {
|
|
|
Level() Level
|
|
|
SetLevel(level Level)
|
|
@@ -22,24 +26,3 @@ type Entry struct {
|
|
|
Level Level
|
|
|
Message string
|
|
|
}
|
|
|
-
|
|
|
-type Logger interface {
|
|
|
- Trace(args ...any)
|
|
|
- Debug(args ...any)
|
|
|
- Info(args ...any)
|
|
|
- Warn(args ...any)
|
|
|
- Error(args ...any)
|
|
|
- Fatal(args ...any)
|
|
|
- Panic(args ...any)
|
|
|
-}
|
|
|
-
|
|
|
-type ContextLogger interface {
|
|
|
- Logger
|
|
|
- TraceContext(ctx context.Context, args ...any)
|
|
|
- DebugContext(ctx context.Context, args ...any)
|
|
|
- InfoContext(ctx context.Context, args ...any)
|
|
|
- WarnContext(ctx context.Context, args ...any)
|
|
|
- ErrorContext(ctx context.Context, args ...any)
|
|
|
- FatalContext(ctx context.Context, args ...any)
|
|
|
- PanicContext(ctx context.Context, args ...any)
|
|
|
-}
|