pub struct ClientLogger<F> { /* private fields */ }Available on crate feature
client only.Expand description
The ClientHandler that emits one log line per request.
Implementations§
Source§impl ClientLogger<()>
impl ClientLogger<()>
Sourcepub fn new() -> ClientLogger<impl ClientLogFormatter>
pub fn new() -> ClientLogger<impl ClientLogFormatter>
Builds a new client logger.
Defaults:
- formatter:
dev_formatter - color mode:
ColorMode::Auto - target:
Target::Stdout
Source§impl<T> ClientLogger<T>
impl<T> ClientLogger<T>
Sourcepub fn with_formatter<Formatter: ClientLogFormatter>(
self,
formatter: Formatter,
) -> ClientLogger<Formatter>
pub fn with_formatter<Formatter: ClientLogFormatter>( self, formatter: Formatter, ) -> ClientLogger<Formatter>
Replace the formatter with any type that implements ClientLogFormatter.
use trillium_logger::client::{ClientLogger, formatters};
ClientLogger::new().with_formatter((formatters::method, " ", formatters::url));Source§impl<F: ClientLogFormatter> ClientLogger<F>
impl<F: ClientLogFormatter> ClientLogger<F>
Sourcepub fn with_color_mode(self, color_mode: ColorMode) -> Self
pub fn with_color_mode(self, color_mode: ColorMode) -> Self
Specify the color mode for this logger. See ColorMode for details.
Sourcepub fn with_target(self, target: impl Targetable) -> Self
pub fn with_target(self, target: impl Targetable) -> Self
Specify the logger target. See Target and Targetable.
Trait Implementations§
Source§impl<F: ClientLogFormatter> ClientHandler for ClientLogger<F>
impl<F: ClientLogFormatter> ClientHandler for ClientLogger<F>
Source§async fn run(&self, conn: &mut Conn) -> Result<()>
async fn run(&self, conn: &mut Conn) -> Result<()>
Forward-pass hook, called before the network round-trip in declared order. Read more
Auto Trait Implementations§
impl<F> !RefUnwindSafe for ClientLogger<F>
impl<F> !UnwindSafe for ClientLogger<F>
impl<F> Freeze for ClientLogger<F>where
F: Freeze,
impl<F> Send for ClientLogger<F>where
F: Send,
impl<F> Sync for ClientLogger<F>where
F: Sync,
impl<F> Unpin for ClientLogger<F>where
F: Unpin,
impl<F> UnsafeUnpin for ClientLogger<F>where
F: UnsafeUnpin,
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