This commit is contained in:
Christoph J. Scherr 2023-08-02 13:10:39 +02:00
commit 3b34933514
Signed by: cscherrNT
GPG Key ID: 8E2B45BC51A27EA7
2 changed files with 47 additions and 1 deletions

View File

@ -107,6 +107,10 @@ impl Logger {
warn!("trying to reinitialize the logger, ignoring"); warn!("trying to reinitialize the logger, ignoring");
return Err(Error::Usage(format!("logging is already initialized"))); return Err(Error::Usage(format!("logging is already initialized")));
} else { } else {
let filter = tracing_subscriber::filter::FilterFn::new(|metadata| {
true
});
let basic_subscriber = tracing_subscriber::fmt::Subscriber::builder() let basic_subscriber = tracing_subscriber::fmt::Subscriber::builder()
// subscriber configuration // subscriber configuration
.with_ansi(ansi) .with_ansi(ansi)
@ -118,7 +122,9 @@ impl Logger {
.with_line_number(display_line_number) .with_line_number(display_line_number)
.with_thread_names(display_thread_names) .with_thread_names(display_thread_names)
//.pretty // too verbose and over multiple lines, a bit like python tracebacks //.pretty // too verbose and over multiple lines, a bit like python tracebacks
.finish(); .finish()
// add layers
.with(filter);
if log_to_file { if log_to_file {
let file_appender = tracing_appender::rolling::daily(log_dir, "log"); let file_appender = tracing_appender::rolling::daily(log_dir, "log");

40
src/math/mod.rs Normal file
View File

@ -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 /////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////