pub struct Logging { /* private fields */ }Expand description
Builder for process-wide Phoenix logging.
Implementations§
Source§impl Logging
impl Logging
pub fn new() -> Logging
pub const fn format(self, format: LogFormat) -> Logging
Sourcepub fn filter(self, filter: impl Into<String>) -> Logging
pub fn filter(self, filter: impl Into<String>) -> Logging
Set the fallback filter used when the configured environment variable is absent.
pub const fn ansi(self, enabled: bool) -> Logging
pub const fn target(self, enabled: bool) -> Logging
Sourcepub fn init(self) -> Result<LoggingGuard, LoggingError>
pub fn init(self) -> Result<LoggingGuard, LoggingError>
Install the subscriber using PHOENIX_LOG, falling back to this builder’s filter.
§Errors
Returns an error for an invalid filter or when another global subscriber is installed.
Sourcepub fn init_with_env(self, variable: &str) -> Result<LoggingGuard, LoggingError>
pub fn init_with_env(self, variable: &str) -> Result<LoggingGuard, LoggingError>
Install the subscriber using a custom environment variable name.
§Errors
Returns an error for an invalid filter or when another global subscriber is installed.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Logging
impl RefUnwindSafe for Logging
impl Send for Logging
impl Sync for Logging
impl Unpin for Logging
impl UnsafeUnpin for Logging
impl UnwindSafe for Logging
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