summaryrefslogtreecommitdiffstats
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
parent9bf9d8c8b3c5d35c63ca9310b8cdb9cf3e46fec7 (diff)
log creation documentation
-rw-r--r--Cargo.lock4
-rw-r--r--src/log.rs5
2 files changed, 7 insertions, 2 deletions
diff --git a/Cargo.lock b/Cargo.lock
index 9f1a34d..5e069af 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -2432,9 +2432,9 @@ dependencies = [
[[package]]
name = "sysinfo"
-version = "0.26.9"
+version = "0.29.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5c18a6156d1f27a9592ee18c1a846ca8dd5c258b7179fc193ae87c74ebb666f5"
+checksum = "02f1dc6930a439cc5d154221b5387d153f8183529b07c19aca24ea31e0a167e1"
dependencies = [
"cfg-if",
"core-foundation-sys",
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(),