extensions

package module
v0.0.0-...-096c66e Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2018 License: MIT Imports: 12 Imported by: 0

README

go-kit-log-extensions

GoDoc

Some extensions to go-kit log package

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrTimeout = errors.New("finished by timeout")

Functions

func MultiLogWrapper

func MultiLogWrapper(loggers ...log.Logger) log.Logger

func NewMultiLogger

func NewMultiLogger(printErrors bool, timeout time.Duration, loggers ...kitlog.Logger) kitlog.Logger

NewMultiLogger creates new MultiLogger instance. If printErrors is true, then besides returning errors within Log function MultiLogger will print all errors of it's child loggers to stderr. To exclude situations when one of the loggers will hang up, timeout variable exists.

func NewMultiLoggerAsync

func NewMultiLoggerAsync(printErrors bool, loggers ...kitlog.Logger) kitlog.Logger

NewMultiLoggerAsync creates new MultiLoggerAsync instance. If printErrors is true, then MultiLoggerAsync will print all errors of it's child loggers to stderr. Warning: if printErrors is false, you will not ever see any errors and they won't be returned in any methods.

func NewMultiLoggerEnchanced

func NewMultiLoggerEnchanced(printErrors bool, timeoutPerLogger time.Duration, loggers ...kitlog.Logger) (kitlog.Logger, error)

NewMultiLoggerEnchanced creates new MultiLoggerEnchanced instance. If printErrors is true, then besides returning errors within Log function MultiLoggerEnchanced will print all errors of it's child loggers to stderr. To exclude situations when one of the loggers will hang up, timeoutPerLogger variable exists.

func NewSlackBackend

func NewSlackBackend(urlStr string, requestTimeout time.Duration, username, author string) (log.Logger, error)

NewSlackBackend creates new slack backend, where urlStr is slack hook url, requestTimeout is a timeout per http request, username is message username and author is an author of attachement, see https://api.slack.com/docs/message-formatting for more info

Types

type MultiLogLight

type MultiLogLight struct {
	// contains filtered or unexported fields
}

func (*MultiLogLight) Log

func (self *MultiLogLight) Log(keyvals ...interface{}) error

type MultiLogger

type MultiLogger struct {
	// contains filtered or unexported fields
}

MultiLogger is a multi logger implementation which call every logger consistently and has timeout per Log call (not for all loggers separately).

func (*MultiLogger) Log

func (self *MultiLogger) Log(keyvals ...interface{}) error

Log implements go-kit logging interface.

type MultiLoggerAsync

type MultiLoggerAsync struct {
	// contains filtered or unexported fields
}

MultiLoggerAsync is a multi logger implementation which call every logger async.

func (*MultiLoggerAsync) Log

func (self *MultiLoggerAsync) Log(keyvals ...interface{}) error

Log implements go-kit logging interface.

type MultiLoggerEnchanced

type MultiLoggerEnchanced struct {
	// contains filtered or unexported fields
}

MultiLoggerEnchanced is a multi logger implementation which call every logger async, but waits until all of them will be finished (configurable timeout per logger exists).

func (*MultiLoggerEnchanced) Log

func (self *MultiLoggerEnchanced) Log(keyvals ...interface{}) error

Log implements go-kit logging interface.

type SentryBackend

type SentryBackend struct {
}

type SlackBackend

type SlackBackend struct {
	// contains filtered or unexported fields
}

SlackBackend implements log interface with ability to log into slack

func (*SlackBackend) Log

func (self *SlackBackend) Log(keyvals ...interface{}) error

Log implements go-kit logging interface.

Jump to

Keyboard shortcuts

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