pub struct PluginLogger { /* private fields */ }Expand description
A logger scoped to a specific plugin.
Obtained via Context::logger().
All messages are logged with target basalt::plugin::<name>,
making them easy to filter in log output.
Methods accept impl Display, so formatting is deferred until
the log level is checked — no allocation if the level is filtered.
§Example
ⓘ
registrar.on::<PlayerJoinedEvent>(Stage::Post, 0, |event, ctx| {
let log = ctx.logger();
log.info(format_args!("{} joined", event.info.username));
log.debug("sending welcome message");
});Implementations§
Source§impl PluginLogger
impl PluginLogger
Auto Trait Implementations§
impl Freeze for PluginLogger
impl RefUnwindSafe for PluginLogger
impl Send for PluginLogger
impl Sync for PluginLogger
impl Unpin for PluginLogger
impl UnsafeUnpin for PluginLogger
impl UnwindSafe for PluginLogger
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more