Struct std_logger::Config
source · pub struct Config<F, Kvs> { /* private fields */ }
Expand description
Implementations§
source§impl Config<(), NoKvs>
impl Config<(), NoKvs>
sourcepub fn logfmt() -> Config<LogFmt, NoKvs>
pub fn logfmt() -> Config<LogFmt, NoKvs>
Logfmt following https://www.brandur.org/logfmt.
sourcepub fn gcloud() -> Config<Gcloud, NoKvs>
pub fn gcloud() -> Config<Gcloud, NoKvs>
Google Cloud Platform structured logging using JSON, following https://cloud.google.com/logging/docs/structured-logging.
source§impl<F, Kvs> Config<F, Kvs>
impl<F, Kvs> Config<F, Kvs>
sourcepub fn with_kvs<K>(self, kvs: K) -> Config<F, K>
pub fn with_kvs<K>(self, kvs: K) -> Config<F, K>
Add the key-values kvs
to all logged messages.
sourcepub fn with_call_location(self, enable: bool) -> Config<F, Kvs>
pub fn with_call_location(self, enable: bool) -> Config<F, Kvs>
Enable or disable logging of the call location.
Default to enable if the debug (or lower) messages are enabled.
sourcepub fn init(self)
pub fn init(self)
Initialise the logger.
See the crate level documentation for more.
§Panics
This will panic if the logger fails to initialise. Use Config::try_init
if
you want to handle the error yourself.
sourcepub fn try_init(self) -> Result<(), SetLoggerError>
pub fn try_init(self) -> Result<(), SetLoggerError>
Try to initialise the logger.
Unlike Config::init
this doesn’t panic when the logger fails to initialise.
See the crate level documentation for more.
Trait Implementations§
Auto Trait Implementations§
impl<F, Kvs> RefUnwindSafe for Config<F, Kvs>where
F: RefUnwindSafe,
Kvs: RefUnwindSafe,
impl<F, Kvs> Send for Config<F, Kvs>
impl<F, Kvs> Sync for Config<F, Kvs>
impl<F, Kvs> Unpin for Config<F, Kvs>
impl<F, Kvs> UnwindSafe for Config<F, Kvs>where
F: UnwindSafe,
Kvs: UnwindSafe,
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