Skip to main content

Crate wde_logger

Crate wde_logger 

Source
Expand description

Logging functions and configuration for WaterDropEngine using tracing.

The logging behavior can be configured using the LogPlugin, which allows you to set the log level, filter logs using EnvFilter syntax, and add custom layers to the tracing subscriber. The RUST_LOG environment variable can also be used to override plugin settings and configure log filtering.

This crate provides multiple macros for logging, including:

  • trace!() - Verbose tracing information, typically only useful for debugging.
  • debug!() - Debug information, useful for development and debugging.
  • info!() - General information about the application’s operation.
  • warn!() - Important warnings that may indicate potential issues.
  • error!() - Critical errors that indicate failures in the application.

Each of these macros also has a corresponding _once variant (e.g. info_once!()) that will only log the message once per call site, which is useful for logging within systems that are called every frame without spamming the logs.

Lastly, span tracing is supported using the *_span!() macros (e.g. info_span!()) which can be used to create spans for better structuring of logs and performance profiling.

Re-exports§

pub use tracing;

Modules§

editor_layer

Macros§

debug
Constructs an event at the debug level.
debug_once
Call debug! once per call site.
debug_span
Constructs a span at the debug level.
error
Constructs an event at the error level.
error_once
Call error! once per call site.
error_span
Constructs a span at the error level.
info
Constructs an event at the info level.
info_once
Call info! once per call site.
info_span
Constructs a span at the info level.
once
Call some expression only once per call site.
trace
Constructs an event at the trace level.
trace_once
Call trace! once per call site.
trace_span
Constructs a span at the trace level.
warn
Constructs an event at the warn level.
warn_once
Call warn! once per call site.
warn_span
Constructs a span at the warn level.

Structs§

LogLevel
Describes the level of verbosity of a span or event.
LogPlugin
Plugin that configures logging for WaterDropEngine applications.
OnceFlag
Wrapper around an AtomicBool, abstracting the backing implementation and ordering considerations.