Module logging

Source
Expand description

Substrate logging library.

This crate uses tokio’s tracing library for logging.

Structs§

EventFormat
A pre-configured event formatter.
FastLocalTime
A structure which, when Displayd, will print out the current local time.
LoggerBuilder
A builder that is used to initialize the global logger.
PrefixLayer
A Layer that captures the prefix span (PREFIX_LOG_SPAN) which is then used by crate::logging::EventFormat to prefix the log lines by customizable string.

Enums§

Error
Logging errors.

Constants§

PREFIX_LOG_SPAN
Span name used for the logging prefix. See macro sc_tracing::logging::prefix_logs_with!

Functions§

add_directives
Add directives to current directives.
get_directives
Returns the current directives.
reload_filter
Reload the logging filter with the supplied directives added to the existing directives
reset_log_filter
Resets the log filter back to the original state when the node was started.

Type Aliases§

Result
Logging Result typedef.

Attribute Macros§

prefix_logs_with
This prefixes all the log lines with [<name>] (after the timestamp). It works by making a tracing’s span that is propagated to all the child calls and child tasks (futures) if they are spawned properly with the SpawnHandle (see TaskManager in sc-cli) or if the futures use .in_current_span() (see tracing-futures).