Categorycosmossdk.io/log
modulepackage
1.5.0
Repository: https://github.com/cosmos/cosmos-sdk.git
Documentation: pkg.go.dev

# README

Log

The cosmossdk.io/log provides a zerolog logging implementation for the Cosmos SDK and Cosmos SDK modules.

To use a logger wrapping an instance of the standard library's log/slog package, use cosmossdk.io/log/slog.

# Packages

Package slog contains a Logger type that satisfies [cosmossdk.io/log.Logger], backed by a standard library [*log/slog.Logger].

# Functions

ColorOption add option to enable/disable coloring of the logs when console writer is in use.
FilterOption sets the filter for the Logger.
HooksOption append hooks to the Logger hooks.
LevelOption sets the level for the Logger.
NewCustomLogger returns a new logger with the given zerolog logger.
NewFilterWriter returns a writer that filters out all key/value pairs that do not match the filter.
NewLogger returns a new logger that writes to the given destination.
NewNopLogger returns a new logger that does nothing.
NewTestLogger returns a logger that calls t.Log to write entries.
NewTestLoggerError returns a test logger that filters out messages below Error level.
NewTestLoggerInfo returns a test logger that filters out messages below info level.
OutputJSONOption sets the output of the logger to JSON.
ParseLogLevel parses complex log level A comma-separated list of module:level pairs with an optional *:level pair (* means all other modules).
TimeFormatOption configures timestamp format of the logger timestamps disabled if empty.
TraceOption add option to enable/disable print of stacktrace on error log.
WithJSONMarshal configures zerolog global json encoding.

# Constants

ModuleKey defines a module logging key.

# Variables

ContextKey is used to store the logger in the context.

# Structs

Config defines configuration for the logger.

# Interfaces

Logger is the Cosmos SDK logger interface.

# Type aliases

FilterFunc is a function that returns true if the log level is filtered for the given key When the filter returns true, the log entry is discarded.
No description provided by the author
TestingT is the interface required for logging in tests.