Documentation ¶
Overview ¶
Example ¶
Code for the README example to make sure it still builds!
// Add an io.Writer logger gelfCfg := NewGelfLoggerConfig() gelfLogger, _ := NewGelfLogger(gelfCfg) gomol.AddLogger(gelfLogger) // Set some global attrs that will be added to all // messages automatically gomol.SetAttr("facility", "gomol.example") gomol.SetAttr("another_attr", 1234) // Initialize the loggers gomol.InitLoggers() defer gomol.ShutdownLoggers() // Log some debug messages with message-level attrs // that will be sent only with that message for idx := 1; idx <= 10; idx++ { gomol.Dbgm( gomol.NewAttrs(). SetAttr("msg_attr1", 4321), "Test message %v", idx) }
Output:
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GelfLogger ¶
type GelfLogger struct {
// contains filtered or unexported fields
}
func NewGelfLogger ¶
func NewGelfLogger(config *GelfLoggerConfig) (*GelfLogger, error)
func (*GelfLogger) InitLogger ¶
func (l *GelfLogger) InitLogger() error
func (*GelfLogger) IsInitialized ¶
func (l *GelfLogger) IsInitialized() bool
func (*GelfLogger) SetBase ¶
func (l *GelfLogger) SetBase(base *gomol.Base)
func (*GelfLogger) ShutdownLogger ¶
func (l *GelfLogger) ShutdownLogger() error
type GelfLoggerConfig ¶
func NewGelfLoggerConfig ¶
func NewGelfLoggerConfig() *GelfLoggerConfig
Click to show internal directories.
Click to hide internal directories.