github.com/sagernet/sing-box@v1.9.0-rc.20/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  	Start() error
    15  	Close() error
    16  	Level() Level
    17  	SetLevel(level Level)
    18  	Logger() ContextLogger
    19  	NewLogger(tag string) ContextLogger
    20  }
    21  
    22  type ObservableFactory interface {
    23  	Factory
    24  	observable.Observable[Entry]
    25  }
    26  
    27  type Entry struct {
    28  	Level   Level
    29  	Message string
    30  }