Logging #26
@ -1,5 +1,14 @@
|
||||
/*!
|
||||
* Containing all singleton and thread-safe structs related to configuring `WANessa`.
|
||||
*
|
||||
* This crate differentiates between `Configs` and `Settings`:
|
||||
* Configs:
|
||||
* - Configs are immutable after they have been initialized. Example [`DbConfig`].
|
||||
* - Changing the config requires a restart of `WANessa`.
|
||||
*
|
||||
* Settings:
|
||||
* - Settings are mutable after they have been initialized. Example [`LogSettings`].
|
||||
* - `WANessa` always uses the current setting and does not need a restart to apply new settings.
|
||||
*/
|
||||
|
||||
pub mod db;
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*!
|
||||
* This module handles logging messages asynchronously and is thread-safe.
|
||||
* It should mostly be called statically.
|
||||
* It should mostly be called statically using the [`log!`] macro.
|
||||
*/
|
||||
|
||||
mod test;
|
||||
@ -92,7 +92,10 @@ pub fn log_to_str(
|
||||
}
|
||||
|
||||
/**
|
||||
* Shorthand version for [`log_message`], which does not require information about the [`config::Config::log_location`].
|
||||
* Shorthand version for [`log_message`], which does not require information about where in the code
|
||||
* the command was called from.
|
||||
* Tries to aqcuire a read lock, if a reference to an instance of [`config::log::LogSettings`] is
|
||||
* not given.
|
||||
*/
|
||||
#[macro_export]
|
||||
macro_rules! log {
|
||||
@ -109,7 +112,7 @@ macro_rules! log {
|
||||
}
|
||||
|
||||
/**
|
||||
* A named typle assigning a log [`LogVerbosity`] to a [`LogMessageType`]
|
||||
* A named typle assigning a log [`LogVerbosity`] to a [`LogMessageType`].
|
||||
*/
|
||||
#[derive(PartialEq, Eq, Debug)]
|
||||
pub struct LogMessage(LogMessageType, LogVerbosity);
|
||||
|
Reference in New Issue
Block a user