sing-box/log/factory.go
2023-04-03 20:24:13 +08:00

30 lines
460 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 {
Level() Level
SetLevel(level Level)
Logger() ContextLogger
NewLogger(tag string) ContextLogger
Close() error
}
type ObservableFactory interface {
Factory
observable.Observable[Entry]
}
type Entry struct {
Level Level
Message string
}