Documentation ¶
Index ¶
Constants ¶
View Source
const ( TypeVoidLogger = "void_logger" TypeFileLogger = "file_logger" )
logger types
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FileMessageLogger ¶
type FileMessageLogger struct { GatewayID string // Gateway id MsgFormatterFunc func(rawMsg *msgTY.RawMessage) string // should supply a func to return parsed message Config fileMessageLoggerConfig // self configurations // contains filtered or unexported fields }
FileMessageLogger struct
func NewFileMessageLogger ¶
func NewFileMessageLogger(logger *zap.Logger, gatewayID string, config cmap.CustomMap, formatterFunc func(rawMsg *msgTY.RawMessage) string, logRootDir string) (*FileMessageLogger, error)
NewFileMessageLogger file logger
func (*FileMessageLogger) AsyncWrite ¶
func (rml *FileMessageLogger) AsyncWrite(rawMsg *msgTY.RawMessage)
AsyncWrite func adds the message into the queue and returns immediately
func (*FileMessageLogger) Close ¶
func (rml *FileMessageLogger) Close()
Close terminates the async runner
func (*FileMessageLogger) Start ¶
func (rml *FileMessageLogger) Start()
Start func inits the the queue and channel and starts the async runner
type MessageLogger ¶
type MessageLogger interface { Start() // Start the message logger Close() // Stop and close the message logger AsyncWrite(rawMsg *msgTY.RawMessage) // write a message }
MessageLogger interface
type NoopMessageLogger ¶
type NoopMessageLogger struct { }
No Operation message logger struct
func (*NoopMessageLogger) AsyncWrite ¶
func (vm *NoopMessageLogger) AsyncWrite(rawMsg *msgTY.RawMessage)
AsyncWrite implementation
Click to show internal directories.
Click to hide internal directories.