sing-box/log/factory.go

31 lines
475 B
Go
Raw Normal View History

2022-07-12 07:17:29 +00:00
package log
import (
"github.com/sagernet/sing/common/logger"
2022-07-12 07:17:29 +00:00
"github.com/sagernet/sing/common/observable"
)
type (
Logger logger.Logger
ContextLogger logger.ContextLogger
)
2022-07-12 07:17:29 +00:00
type Factory interface {
Start() error
Close() error
2022-07-12 07:17:29 +00:00
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
}