22 lines
425 B
Rust
22 lines
425 B
Rust
|
/// LoggingLifecycle is used to create log messages upon creation, and log messages when it is dropped
|
||
|
#[doc(hidden)]
|
||
|
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);
|
||
|
}
|
||
|
}
|