Documentation
¶
Overview ¶
DefaultLogger is so simple that it's laughable
The point of this package is to create a layer of abstraction on top of your favorite Go logging library, so that you can use your favorite logging library in Trinkets. A valid Logger implementation needs only 2 methods: * Info(string, ...interface{}) * Error(string, ...interface{})
To enable this you would use:
logger.SetupLogBuilder(func(name string) logger.Logger { return your.Logger(name) })
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetupLogBuilder ¶
func SetupLogBuilder(b LogBuilderType)
SetupLogBuilder helper is used for setting up the log builder function
Types ¶
type Attrs ¶
type Attrs map[string]interface{}
Attrs are used for providing additional info in the log messages
type DefaultLogger ¶ added in v0.2.0
type DefaultLogger struct { // Name by which the logger is identified Name string }
DefaultLogger is a basic "fmt.print" logger
func (*DefaultLogger) Error ¶ added in v0.2.0
func (l *DefaultLogger) Error(msg string, v ...interface{})
Error prints an error message
func (*DefaultLogger) Info ¶ added in v0.2.0
func (l *DefaultLogger) Info(msg string, v ...interface{})
Info prints information to the screen
type LogBuilderType ¶ added in v0.2.0
LogBuilderType function builds new log instances
var NewLogger LogBuilderType
NewLogger builder function