2024-03-18 12:30:31 +00:00
|
|
|
/// LoggingLifecycle is used to create log messages upon creation, and log messages when it is dropped
|
|
|
|
#[doc(hidden)]
|
2024-04-02 20:12:08 +00:00
|
|
|
#[non_exhaustive]
|
2024-03-18 12:30:31 +00:00
|
|
|
pub struct LoggingLifecycle {
|
|
|
|
identifier: String,
|
|
|
|
}
|
|
|
|
|
|
|
|
impl LoggingLifecycle {
|
|
|
|
#[doc(hidden)]
|
|
|
|
pub fn new(identifier: String) -> Self {
|
|
|
|
debug!("Started {}", identifier);
|
|
|
|
Self {
|
|
|
|
identifier,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl Drop for LoggingLifecycle {
|
|
|
|
fn drop(&mut self) {
|
|
|
|
debug!("Stopped {}", self.identifier);
|
|
|
|
}
|
|
|
|
}
|