Documentation ¶
Index ¶
- func Flush()
- func GetLoggingConfig() *config.LoggingConfig
- func RegisterWebsocketHandler(...)
- func SetLogging(loggingCfg *config.LoggingConfig, appName string, baseDir string)
- type BufferedWriter
- type ConsoleWriter
- type EmptyLogger
- type FileReceiver
- type RollingFileWriterSize
- type RollingFileWriterTime
- type WebsocketReceiver
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetLoggingConfig ¶
func GetLoggingConfig() *config.LoggingConfig
GetLoggingConfig return logging configs
func RegisterWebsocketHandler ¶
func RegisterWebsocketHandler(func1 func(message string, level log.LogLevel, context log.LogContextInterface))
RegisterWebsocketHandler used to register websocket handler
func SetLogging ¶
func SetLogging(loggingCfg *config.LoggingConfig, appName string, baseDir string)
SetLogging init set logging
Types ¶
type BufferedWriter ¶
type BufferedWriter struct {
// contains filtered or unexported fields
}
BufferedWriter stores data in memory and flushes it every flushPeriod or when buffer is full
func NewBufferedWriter ¶
func NewBufferedWriter(innerWriter io.Writer, bufferSize int, flushPeriod time.Duration) (*BufferedWriter, error)
NewBufferedWriter creates a new buffered writer struct. bufferSize -- size of memory buffer in bytes flushPeriod -- period in which data flushes from memory buffer in milliseconds. 0 - turn off this functionality
func (*BufferedWriter) String ¶
func (bufWriter *BufferedWriter) String() string
type ConsoleWriter ¶
type ConsoleWriter struct { }
ConsoleWriter is used to write to console
func NewConsoleWriter ¶
func NewConsoleWriter() (*ConsoleWriter, error)
NewConsoleWriter creates a new console writer. Returns error, if the console writer couldn't be created.
func (*ConsoleWriter) String ¶
func (console *ConsoleWriter) String() string
String return writer name
type EmptyLogger ¶
type EmptyLogger struct { }
type FileReceiver ¶
type FileReceiver struct {
// contains filtered or unexported fields
}
FileReceiver is a struct of file log receiver, which implements seelog.CustomReceiver
func NewFileReceiver ¶
func NewFileReceiver(writer io.Writer, minLogLevel log.LogLevel) *FileReceiver
func (*FileReceiver) AfterParse ¶
func (ar *FileReceiver) AfterParse(initArgs log.CustomReceiverInitArgs) error
AfterParse nothing to do here
func (*FileReceiver) ReceiveMessage ¶
func (ar *FileReceiver) ReceiveMessage(message string, level log.LogLevel, context log.LogContextInterface) error
ReceiveMessage impl how to receive log message
type RollingFileWriterSize ¶
type RollingFileWriterSize struct {
// contains filtered or unexported fields
}
RollingFileWriterSize performs roll when file exceeds a specified limit.
func NewRollingFileWriterSize ¶
func NewRollingFileWriterSize(fpath string, atype rollingArchiveType, apath string, maxSize int64, maxRolls int, namemode rollingNameMode) (*RollingFileWriterSize, error)
NewRollingFileWriterSize create a new writer with several parameters
func (*RollingFileWriterSize) String ¶
func (rws *RollingFileWriterSize) String() string
type RollingFileWriterTime ¶
type RollingFileWriterTime struct {
// contains filtered or unexported fields
}
RollingFileWriterTime performs roll when a specified time interval has passed.
func NewRollingFileWriterTime ¶
func NewRollingFileWriterTime(fpath string, atype rollingArchiveType, apath string, maxr int, timePattern string, interval rollingIntervalType, namemode rollingNameMode) (*RollingFileWriterTime, error)
NewRollingFileWriterTime create rolling writer
func (*RollingFileWriterTime) String ¶
func (rwt *RollingFileWriterTime) String() string
type WebsocketReceiver ¶
type WebsocketReceiver struct {
// contains filtered or unexported fields
}
WebsocketReceiver is a struct of websocket log receiver, which implements seelog.CustomReceiver
func (*WebsocketReceiver) AfterParse ¶
func (ar *WebsocketReceiver) AfterParse(initArgs log.CustomReceiverInitArgs) error
AfterParse nothing to do here
func (*WebsocketReceiver) ReceiveMessage ¶
func (ar *WebsocketReceiver) ReceiveMessage(message string, level log.LogLevel, context log.LogContextInterface) error
ReceiveMessage impl how to receive log message