summaryrefslogtreecommitdiffstats
path: root/src/log.rs
diff options
context:
space:
mode:
authorquentin konieczko <konieczko@gmail.com>2023-05-17 15:56:53 +0200
committerquentin konieczko <konieczko@gmail.com>2023-05-17 15:56:53 +0200
commitbc0340ddac88a8cacc4bf82ded23763821902562 (patch)
treea8f6d39552005d31212225bd0d8741c8acfc82fc /src/log.rs
parent9bf9d8c8b3c5d35c63ca9310b8cdb9cf3e46fec7 (diff)
log creation documentation
Diffstat (limited to 'src/log.rs')
-rw-r--r--src/log.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/log.rs b/src/log.rs
index 0f0723f..a5a9518 100644
--- a/src/log.rs
+++ b/src/log.rs
@@ -4,6 +4,11 @@ use log4rs;
use crate::constant_strings_paths::{ACTION_LOG_PATH, LOG_CONFIG_PATH};
use crate::utils::extract_lines;
+/// Set the logs.
+/// The configuration is read from a config file defined in `LOG_CONFIG_PATH`
+/// It's a YAML file which defines 2 logs:
+/// - a normal one used directly with the macros like `log::info!(...)`, used for debugging
+/// - a special one used with `log::info!(target: "special", ...)` to be displayed in the application
pub fn set_loggers() -> Result<()> {
log4rs::init_file(
shellexpand::tilde(LOG_CONFIG_PATH).as_ref(),