[−][src]Struct ll::Logger
Implementations
impl Logger[src]
pub fn new() -> Self[src]
pub fn stdout() -> Self[src]
pub fn add_drain(&mut self, drain: Arc<dyn Drain + Send + Sync>)[src]
pub fn set_log_level(&mut self, log_level: Level)[src]
pub fn set_event_name_prefix<S: Into<String>>(&mut self, prefix: S)[src]
pub fn nest(&self, prefix: impl Into<String>) -> Logger[src]
Create a nested logger that will have a prefix added to it for all events.
let l = ll::Logger::new(); l.event("some_event", |_| Ok(())).unwrap(); let l2 = l.nest("my_app"); l2.event("some_app_event", |_| Ok(())).unwrap(); let l3 = l.nest("db"); l2.event("some_db_event", |_| Ok(())).unwrap(); // Will print // [ ] some_event // [ ] my_app:some_app_event // [ ] my_app:db:some_db_event
pub fn add_data<K: Into<String>, V: Into<DataValue>>(
&mut self,
key: K,
value: V
)[src]
&mut self,
key: K,
value: V
)
Add key/value paris data to the logger. Every event logged from this logger instance will have these k/v pairs associated with them.
pub fn event<E: Into<String>, F, T>(&self, event_name: E, f: F) -> Result<T> where
F: FnOnce(OngoingEvent) -> Result<T>, [src]
F: FnOnce(OngoingEvent) -> Result<T>,
pub async fn async_event<E: Into<String>, FN, FT, T, '_>(
&'_ self,
event_name: E,
f: FN
) -> Result<T> where
FN: FnOnce(OngoingEvent) -> FT,
FT: Future<Output = Result<T>>, [src]
&'_ self,
event_name: E,
f: FN
) -> Result<T> where
FN: FnOnce(OngoingEvent) -> FT,
FT: Future<Output = Result<T>>,
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Logger
impl Send for Logger
impl Sync for Logger
impl Unpin for Logger
impl !UnwindSafe for Logger
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T[src]
fn clone_into(&self, target: &mut T)[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,