package
0.0.0-20210712090754-55a2f5289189
Repository: https://github.com/d-platformoperatingsystem/dpos.git
Documentation: pkg.go.dev

# Packages

No description provided by the author

# Functions

BufferedHandler writes all records to a buffered channel of the given size which flushes into the wrapped handler whenever it is available for writing.
CallerFileHandler returns a Handler that adds the line number and file of the calling function to the context with key "caller".
CallerFuncHandler returns a Handler that adds the calling function name to the context with key "fn".
CallerStackHandler returns a Handler that adds a stack trace to the context with key "stack".
ChannelHandler writes all records to the given channel.
Crit is a convenient alias for Root().Crit.
Debug is a convenient alias for Root().Debug.
DiscardHandler reports success for all writes but does nothing.
Error is a convenient alias for Root().Error.
FailoverHandler writes all log records to the first handler specified, but will failover and write to the second handler if the first handler has failed, and so on for all handlers specified.
FileHandler returns a handler which writes log records to the give file using the given format.
FilterHandler returns a Handler that only writes records to the wrapped Handler if the given function evaluates true.
FormatFunc returns a new Format object which uses the given function to perform record formatting.
FuncHandler returns a Handler that logs records with the given function.
Info is a convenient alias for Root().Info.
JSONFormat formats log records as JSON objects separated by newlines.
JSONFormatEx formats log records as JSON objects.
LazyHandler writes all values to the wrapped handler after evaluating any lazy functions in the record's context.
LogfmtFormat prints records in logfmt format, an easy machine-parseable but human-readable format for key/value pairs.
LvlFilterHandler returns a Handler that only writes records which are less than the given verbosity level to the wrapped Handler.
LvlFromString returns the appropriate Lvl from a string name.
MatchFilterHandler returns a Handler that only writes records to the wrapped Handler if the given key in the logged context matches the value.
MultiHandler ...
NetHandler opens a socket to the given address and writes records over the connection.
New returns a new logger with the given context.
Root returns the root logger.
StreamHandler writes log records to an io.Writer with the given format.
SyncHandler can be wrapped around a handler to guarantee that only a single Log operation can proceed at a time.
SyslogHandler opens a connection to the system syslog daemon by calling syslog.New and writes all records to it.
SyslogNetHandler opens a connection to a log daemon over the network and writes all log records to it.
TerminalFormat formats log records optimized for human readability on a terminal with color-coded level output and terser human friendly timestamp.
Warn is a convenient alias for Root().Warn.

# Constants

List of predefined log Levels.
List of predefined log Levels.
List of predefined log Levels.
List of predefined log Levels.
List of predefined log Levels.

# Variables

Must object provides the following Handler creation functions which instead of returning an error parameter only return a Handler and panic on failure: FileHandler, NetHandler, SyslogHandler, SyslogNetHandler.
Predefined handlers.
Predefined handlers.

# Structs

Lazy allows you to defer calculation of a logged value that is expensive to compute until it is certain that it must be evaluated with the given filters.
A Record is what a Logger asks its handler to write.
RecordKeyNames are the predefined names of the log props used by the Logger interface.

# Interfaces

Format is the interface implemented by StreamHandler formatters.
Handler interface defines where and how log records are written.
A Logger writes key/value pairs to a Handler.

# Type aliases

Ctx is a map of key/value pairs to pass as context to a log function Use this only if you really need greater safety around the arguments you pass to the logging functions.
Lvl is a type for predefined log levels.