Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LogData ¶
type LogData map[string]interface{}
Metadata associated with a logger and passed to log events
type LogEvent ¶
type LogEvent struct {
// Log levels:
// - debug
// - info
// - warn
// - error
Level string
// Identifies the type of event with a unique name
Name string
// Metadata available to the log event
Data LogData
}
LogEvent is created for each log that occurs and explains details about the log message.
func (*LogEvent) DataToBool ¶
DataToBool safely returns the Data[key] value as a bool
func (*LogEvent) DataToString ¶
DataToString safely returns the Data[key] value as a string
func (*LogEvent) DataToStringSlice ¶
DataToString safely returns the Data[key] value as a string
type Logger ¶
type Logger struct {
// Public metadata that is attached to each log event
Data LogData
// contains filtered or unexported fields
}
Logger allows you to log events that another package can subscribe to and act upon. TODO - Can Logger be private requiring `logger.New` to be used? How do we pass instances of `logger` when private?
func New ¶
func New(onEvent eventFunc) *Logger
Logger constructor that binds to an error, success, and event handler
func (*Logger) SuccessEvent ¶
Success return an event with the name "success"