From e64cd9015d7f22f928971ec90b873dcdc1c2cd79 Mon Sep 17 00:00:00 2001 From: PlexSheep Date: Tue, 1 Aug 2023 20:06:19 +0200 Subject: [PATCH 1/2] add math module --- src/math/mod.rs | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 src/math/mod.rs diff --git a/src/math/mod.rs b/src/math/mod.rs new file mode 100644 index 0000000..dac9d32 --- /dev/null +++ b/src/math/mod.rs @@ -0,0 +1,40 @@ +//! # very short description +//! +//! Short description +//! +//! Details +//! +//! ## Section 1 +//! +//! ## Section 2 + +//// ATTRIBUTES //////////////////////////////////////////////////////////////////////////////////// +// we want docs +#![warn(missing_docs)] +#![warn(rustdoc::missing_crate_level_docs)] +// we want Debug everywhere. +#![warn(missing_debug_implementations)] +// enable clippy's extra lints, the pedantic version +#![warn(clippy::pedantic)] + +//// IMPORTS /////////////////////////////////////////////////////////////////////////////////////// + +//// TYPES ///////////////////////////////////////////////////////////////////////////////////////// + +//// CONSTANTS ///////////////////////////////////////////////////////////////////////////////////// + +//// STATICS /////////////////////////////////////////////////////////////////////////////////////// + +//// MACROS //////////////////////////////////////////////////////////////////////////////////////// + +//// ENUMS ///////////////////////////////////////////////////////////////////////////////////////// + +//// STRUCTS /////////////////////////////////////////////////////////////////////////////////////// + +//// IMPLEMENTATION //////////////////////////////////////////////////////////////////////////////// + +//// PUBLIC FUNCTIONS ////////////////////////////////////////////////////////////////////////////// + +//// PRIVATE FUNCTIONS ///////////////////////////////////////////////////////////////////////////// + +//////////////////////////////////////////////////////////////////////////////////////////////////// From 0e7714d8e0d1490bebb72067803d3e9b88a9df33 Mon Sep 17 00:00:00 2001 From: PlexSheep Date: Wed, 2 Aug 2023 13:07:46 +0200 Subject: [PATCH 2/2] add filter skeleton for logger --- src/logger/mod.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/logger/mod.rs b/src/logger/mod.rs index 6ca1501..2a99796 100644 --- a/src/logger/mod.rs +++ b/src/logger/mod.rs @@ -107,6 +107,10 @@ impl Logger { warn!("trying to reinitialize the logger, ignoring"); return Err(Error::Usage(format!("logging is already initialized"))); } else { + let filter = tracing_subscriber::filter::FilterFn::new(|metadata| { + true + }); + let basic_subscriber = tracing_subscriber::fmt::Subscriber::builder() // subscriber configuration .with_ansi(ansi) @@ -118,7 +122,9 @@ impl Logger { .with_line_number(display_line_number) .with_thread_names(display_thread_names) //.pretty // too verbose and over multiple lines, a bit like python tracebacks - .finish(); + .finish() + // add layers + .with(filter); if log_to_file { let file_appender = tracing_appender::rolling::daily(log_dir, "log");