package
1.3.1
Repository: https://github.com/datawire/dlib.git
Documentation: pkg.go.dev

# Functions

No description provided by the author
No description provided by the author
No description provided by the author
DefaultFieldSort is the field sorter that is used by the default fallback logger.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
MaxLogLevel returns the maximum loglevel of the Logger associated with the ctx if that logger implements the LoggerWithMaxLevel interface, or the highest possible level (LogLevelTrace) if it doesn't.
NewTestContext is like NewTestContextWithOpts but allows for the failOnError option to be set as a boolean.
NewTestContextWithOpts takes a testing.TB (that is: either a *testing.T or a *testing.B) and returns a good default Context to use in unit test.
No description provided by the author
No description provided by the author
No description provided by the author
SetFallbackLogger sets the Logger that is returned for a context that doesn't have a Logger associated with it.
StdLogger returns a stdlib *log.Logger that uses the Logger associated with ctx and logs at the specified loglevel.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
WithFailOnError sets a test context to fail on calling any of the dlog.Error{,f,ln} functions.
WithField returns a copy of ctx with the logger field key=value associated with it, for future calls to {Trace,Debug,Info,Print,Warn,Error}{f,ln,}() and StdLogger().
WithLogger returns a copy of ctx with logger associated with it, for future calls to {Trace,Debug,Info,Print,Warn,Error}{f,ln,}() and StdLogger().
WithTimestampLogging sets a test context to always log timestamps Note that these will be logged as log fields.
WrapLogrus converts a logrus *Logger into a generic Logger.
WrapTB converts a testing.TB (that is: either a *testing.T or a *testing.B) into a generic Logger.

# Constants

LogLevelDebug is for debugging.
LogLevelError is for errors that should definitely be noted.
LogLevelInfo is for general operational entries about what's going on inside the application.
LogLevelTrace is for extreme debugging.
LogLevelWarn is for non-critical entries that deserve eyes.

# Interfaces

Logger is a generic logging interface that most loggers implement, so that consumers don't need to care about the actual log implementation.
LoggerWithMaxLevel can be implemented by loggers that define a maximum level that will be logged, e.g.
OptimizedLogger is a Logger that takes on the complexity of formatting log lines in to a string.

# Type aliases

LogLevel is an abstracted common log-level type for Logger.StdLogger().
TestContextOption represents options that can be set on test contexts.