sing-box/log/factory.go
世界 abd4d8b367
Avoid opening log output before start &
Replace tracing logs with task monitor
2023-12-18 22:26:01 +08:00

31 lines
475 B
Go

package log
import (
"github.com/sagernet/sing/common/logger"
"github.com/sagernet/sing/common/observable"
)
type (
Logger logger.Logger
ContextLogger logger.ContextLogger
)
type Factory interface {
Start() error
Close() error
Level() Level
SetLevel(level Level)
Logger() ContextLogger
NewLogger(tag string) ContextLogger
}
type ObservableFactory interface {
Factory
observable.Observable[Entry]
}
type Entry struct {
Level Level
Message string
}