watermill

package module
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 3, 2020 License: MIT Imports: 4 Imported by: 4

README

Logur integration for Watermill

GitHub Workflow Status Codecov Go Report Card Go Version go.dev reference

Installation

go get logur.dev/integration/watermill

Usage

package main

import (
	"logur.dev/logur"
	watermillintegration "logur.dev/integration/watermill"
)

func main() {
	logger := watermillintegration.New(logur.NewNoopLogger())
}

Development

When all coding and testing is done, please run the test suite:

$ make check

License

The MIT License (MIT). Please see License File for more information.

Documentation

Overview

Package watermill provides Logur integration for Watermill.

Index

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

func New(logger logur.Logger) *Logger

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.

func (*Logger) Debug

func (l *Logger) Debug(msg string, fields watermill.LogFields)

func (*Logger) Error

func (l *Logger) Error(msg string, err error, fields watermill.LogFields)

func (*Logger) Info

func (l *Logger) Info(msg string, fields watermill.LogFields)

func (*Logger) Trace

func (l *Logger) Trace(msg string, fields watermill.LogFields)

func (*Logger) With

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL