burrow: github.com/hyperledger/burrow/logging Index | Files | Directories

package logging

import "github.com/hyperledger/burrow/logging"

Index

Package Files

logger.go terminal.go

func Colors Uses

func Colors(keyvals ...interface{}) term.FgBgColor

func Msg Uses

func Msg(logger log.Logger, message string, keyvals ...interface{}) error

Record a structured log line with a message

type Logger Uses

type Logger struct {
    // Send a log message to the Info channel, formed of a sequence of key value
    // pairs. Info messages should be operationally interesting to a human who is
    // monitoring the logs. But not necessarily a human who is trying to
    // understand or debug the system. Any handled errors or warnings should be
    // sent to the Info channel (where you may wish to tag them with a suitable
    // key-value pair to categorise them as such).
    Info log.Logger
    // Send an log message to the Trace channel, formed of a sequence of key-value
    // pairs. Trace messages can be used for any state change in the system that
    // may be of interest to a machine consumer or a human who is trying to debug
    // the system or trying to understand the system in detail. If the messages
    // are very point-like and contain little structure, consider using a metric
    // instead.
    Trace  log.Logger
    Output *log.SwapLogger
}

InfoTraceLogger maintains provides two logging 'channels' that are interlaced to provide a coarse grained filter to distinguish human-consumable 'Info' messages and execution level 'Trace' messages.

func NewLogger Uses

func NewLogger(outputLogger log.Logger) *Logger

Create an InfoTraceLogger by passing the initial outputLogger.

func NewNoopLogger Uses

func NewNoopLogger() *Logger

func (*Logger) InfoMsg Uses

func (l *Logger) InfoMsg(message string, keyvals ...interface{}) error

Record structured Info log line with a message

func (*Logger) Reload Uses

func (l *Logger) Reload() error

func (*Logger) SwapOutput Uses

func (l *Logger) SwapOutput(infoLogger log.Logger)

Hot swap the underlying outputLogger with another one to re-route messages

func (*Logger) Sync Uses

func (l *Logger) Sync() error

Handle signals

func (*Logger) TraceMsg Uses

func (l *Logger) TraceMsg(message string, keyvals ...interface{}) error

Record structured Trace log line with a message

func (*Logger) With Uses

func (l *Logger) With(keyvals ...interface{}) *Logger

A logging context (see go-kit log's Context). Takes a sequence key values via With or WithPrefix and ensures future calls to log will have those contextual values appended to the call to an underlying logger. Values can be dynamic by passing an instance of the log.Valuer interface This provides an interface version of the log.Context struct to be used For implementations that wrap a log.Context. In addition it makes no assumption about the name or signature of the logging method(s). See InfoTraceLogger

func (*Logger) WithInfo Uses

func (l *Logger) WithInfo(keyvals ...interface{}) *Logger

Establish a context on the Info channel keeping Trace the same

func (*Logger) WithPrefix Uses

func (l *Logger) WithPrefix(keyvals ...interface{}) *Logger

func (*Logger) WithScope Uses

func (l *Logger) WithScope(scopeName string) *Logger

Establish or extend the scope of this logger by appending scopeName to the Scope vector. Like With the logging scope is append only but can be used to provide parenthetical scopes by hanging on to the parent scope and using once the scope has been exited. The scope mechanism does is agnostic to the type of scope so can be used to identify certain segments of the call stack, a lexical scope, or any other nested scope.

func (*Logger) WithTrace Uses

func (l *Logger) WithTrace(keyvals ...interface{}) *Logger

Establish a context on the Trace channel keeping Info the same

Directories

PathSynopsis
errors
logconfig
logconfig/presets
loggers
structure

Package logging imports 4 packages (graph) and is imported by 205 packages. Updated 2020-04-23. Refresh now. Tools for package owners.