package
0.0.0-20220821105735-b124b1e83613
Repository: https://github.com/wooyang2018/corechain.git
Documentation: pkg.go.dev
# Functions
BoundLvlFilterHandler returns a Handler that only writes records which are less than the given `maxLvl` verbosity level and greater than `minLvl` level to the wrapped Handler.
BufferedHandler writes all records to a buffered channel of the given size which flushes into the wrapped handler whenever it is available for writing.
Caller returns a Call from the stack of the current goroutine.
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().Fatal.
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 logger 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 dispatches any write to each of its handlers.
NetHandler opens a socket to the given address and writes records over the connection.
New returns a new logger with the given context.
No description provided by the author
Root returns the root logger.
RotateFileHandler returns a handler which writes log records to the give file using the given format.
Trace returns a CallStack for the current goroutine with element 0 identifying the calling function.
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.
Trace is a convenient alias for Root().Trace.
Warn is a convenient alias for Root().Warn.
# Variables
ErrNoFunc means that the Call has a nil *runtime.Func.
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
Call records a single function invocation from a goroutine stack.
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.
No description provided by the author
# Type aliases
CallStack records a sequence of function invocations from a goroutine stack.
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.