package
0.4.1
Repository: https://github.com/obsidiandynamics/libstdgo.git
Documentation: pkg.go.dev

# Packages

Package glog provides a Glog binding for Scribe.
Package log15 provides a Log15 binding for Scribe.
Package logrus provides a Logrus binding for Scribe.
Package overlog provides a reference logging implementation for Scribe.
Package seelog provides a Seelog binding for Scribe.
Package zap provides a Zap binding for Scribe.

# Functions

AField is satisfied if the scene contains a field with the given name-value pair.
AFieldNamed is satisfied if the scene contains a field with the given name.
AnError is satisfied if the scene holds an error.
Anything is a predicate that matches any entry.
AppendScene is a hook that appends the contents of the captured scene after the formatted log message.
ASceneWith returns a conventional (Entry) predicate that satisfies the given ScenePredicate.
BindFmt creates a binding for the logger used by fmt.
BindLogPrintf creates a pass-through binding for log.Printf().
Content is satisfied if the scene has any of its fields set.
Count ensures that the number of entries equals the given expected number.
CountAtLeast ensures that there is a minimum number of entries.
CountAtMost ensures that there is a maximum number of entries.
Fac wraps a given reusable logger function in a factory.
LevelName gets the name of the given level, if one is known.
LevelNameAbbreviated gives the abbreviated name for a given level.
LogLevel matches all entries that are logged at the given level.
MessageContaining matches entries where the formatted message contains the given substr.
MessageEqual matches entries where the formatted message exactly matches the expected string.
New constructs a Scribe instance from the given facs configuration.
NewMock creates a new MockScribe.
Nop is a no-op logger function.
Not produces a logical inverse of a predicate.
ParseLevelName locates a LevelSpec for a given name string, returning an error if none could be matched.
ShimFac applies a shim to fac, using the given hook.
ShimFacs applies a shim to all factories in facs, using the given hook, returning an equivalent map of shimmed factories.
Space appends a whitespace character to the given buffer if the latter is non-empty.
StandardBinding creates a shim-based binding for log.Printf(), appending scene information.
WriteScene is a utility for compactly writing scene contents to an output writer.

# Constants

All is a symbolic value for the lowest possible level.
Debug level.
DefaultEnabledLevel specifies the level of logging which is enabled by default.
Error is the most coarse-grained level that actually gets logged.
Info level.
Off is a symbolic value for the highest possible level.
Trace is the most fine-grained level that actually gets logged.
Warn level.

# Variables

Levels lists built-in levels (including the two symbolic ones, All and Off), mapping them to their descriptions.

# Structs

DynamicAssertion permits the testing of captures housed by the ScribeMock, rather than the Entries snapshot.
Entry
Entry is a single, captured log entry.
LevelSpec describes a log level.
Scene captures additional metadata from the call site that is forwarded to the logger.

# Interfaces

Entries is an immutable snapshot of captured log calls.
MockScribe provides a facility for mocking a Scribe, capturing log calls for subsequent inspection, filtering and assertions.
Scribe is the starting point for invoking a logger.
StdLogAPI represents the standard way of interacting with Scribe.

# Type aliases

Assertion is a verification of Entries that returns a nil string if the assertion passes, or a string describing the nature of the failure otherwise.
Fields is a free-form set of attributes that can be captured as part of a Scene, supporting log enrichment and structured logging.
Hook is a function that can inspect log arguments before they are passed to the underlying logger, and potentially modify these arguments.
Level of logging.
Logger is a single-use function for logging output.
LoggerFactories is used to configure Scribe, specifying a LogFactory for each supported level.
LoggerFactory specifies the behaviour for constructing a logger instance.
Predicate is a condition evaluated against a given entry, returning true if the underlying condition has been satisfied.
ScenePredicate is a refinement of the predicate concept, applying to the Scene field of an Entry (as opposed to the entire Entry struct).