From 1c92f95901e499e14bd3940485d3dbe17ed327cc Mon Sep 17 00:00:00 2001 From: PlexSheep Date: Tue, 9 Jul 2024 19:37:13 +0200 Subject: [PATCH] docs(log): add an example for using a logfile --- members/libpt-log/examples/logfile.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 members/libpt-log/examples/logfile.rs diff --git a/members/libpt-log/examples/logfile.rs b/members/libpt-log/examples/logfile.rs new file mode 100644 index 0000000..fadc7bc --- /dev/null +++ b/members/libpt-log/examples/logfile.rs @@ -0,0 +1,11 @@ +use libpt_log::Logger; +use tracing::info; + +fn main() { + let _logger = Logger::builder() + .log_to_file(true) + .log_dir("/tmp/llll".into()) + .build() + .unwrap(); + info!("foo bar qux"); +}