Documentation
¶
Overview ¶
Package watermill provides Logur integration for Watermill.
Index ¶
- type ErrorHandler
- type Logger
- func (l *Logger) Debug(msg string, fields watermill.LogFields)
- func (l *Logger) Error(msg string, err error, fields watermill.LogFields)
- func (l *Logger) Info(msg string, fields watermill.LogFields)
- func (l *Logger) Trace(msg string, fields watermill.LogFields)
- func (l *Logger) With(fields watermill.LogFields) watermill.LoggerAdapter
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ErrorHandler ¶
type ErrorHandler interface { // Handle handles an error passed to the logger. Handle(err error, fields map[string]interface{}) }
ErrorHandler handles an error passed to the logger.
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger is a github.com/ThreeDotsLabs/watermill.LoggerAdapter compatible logger.
func New ¶
New returns a github.com/ThreeDotsLabs/watermill.LoggerAdapter compatible logger.
Example ¶
package main import ( "logur.dev/logur" watermillintegration "logur.dev/integration/watermill" ) func main() { logger := watermillintegration.New(logur.NoopLogger{}) _ = logger }
Output:
func NewWithErrorHandler ¶
func NewWithErrorHandler(logger logur.Logger, errorHandler ErrorHandler) *Logger
NewWithErrorHandler returns a github.com/ThreeDotsLabs/watermill.LoggerAdapter compatible logger. Compared to the logger returned by New, this logger sends errors to the error handler.
Click to show internal directories.
Click to hide internal directories.