Documentation ¶
Index ¶
- Variables
- func MultiLogWrapper(loggers ...log.Logger) log.Logger
- func NewMultiLogger(printErrors bool, timeout time.Duration, loggers ...kitlog.Logger) kitlog.Logger
- func NewMultiLoggerAsync(printErrors bool, loggers ...kitlog.Logger) kitlog.Logger
- func NewMultiLoggerEnchanced(printErrors bool, timeoutPerLogger time.Duration, loggers ...kitlog.Logger) (kitlog.Logger, error)
- func NewSlackBackend(urlStr string, requestTimeout time.Duration, username, author string) (log.Logger, error)
- type MultiLogLight
- type MultiLogger
- type MultiLoggerAsync
- type MultiLoggerEnchanced
- type SentryBackend
- type SlackBackend
Constants ¶
This section is empty.
Variables ¶
var ErrTimeout = errors.New("finished by timeout")
Functions ¶
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 ¶
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.