Expand description
Plumbing for using the log crate across FFI-boundaries.
By setting up a chain from ForwardLogger => LogTarget
=> Log, a dynamically loaded library can effectively log
to the calling library’s logging implementation.
§Usage
- Set up logging as usual
- Construct a
StaticLogTargetin the same library - Pass the
LogTargetthrough FFI - Register a
ForwardLoggerin the dynamic library - Use the
logcrate as usual
Note: The max logging level is only set once, when
the ForwardLogger is registered.
Modules§
- This module is generated by the
#[sabi_trait]attribute on LogTarget
Structs§
- Logger that forwards calls to a
LogTarget. - The trait object for LogTarget.
LogTargetthat does nothing.LogTargetthat forwards calls to the statically registered logger of the library it was constructed in.
Traits§
- FFI-safe version of
Log.
Type Aliases§
- FFI-safe
LogTargettrait object. - A type alias for the const-constructible
LogTarget_TO.