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
StaticLogTarget
in the same library - Pass the
LogTarget
through FFI - Register a
ForwardLogger
in the dynamic library - Use the
log
crate 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.
LogTarget
that does nothing.LogTarget
that forwards calls to the statically registered logger of the library it was constructed in.
Traits§
- FFI-safe version of
Log
.
Type Aliases§
- FFI-safe
LogTarget
trait object. - A type alias for the const-constructible
LogTarget_TO
.