github.com/inazumav/sing-box@v0.0.0-20230926072359-ab51429a14f1/log/factory.go (about) 1 package log 2 3 import ( 4 "github.com/sagernet/sing/common/logger" 5 "github.com/sagernet/sing/common/observable" 6 ) 7 8 type ( 9 Logger logger.Logger 10 ContextLogger logger.ContextLogger 11 ) 12 13 type Factory interface { 14 Level() Level 15 SetLevel(level Level) 16 Logger() ContextLogger 17 NewLogger(tag string) ContextLogger 18 Close() error 19 } 20 21 type ObservableFactory interface { 22 Factory 23 observable.Observable[Entry] 24 } 25 26 type Entry struct { 27 Level Level 28 Message string 29 }