generated from GarandPLG/rust-flake-template
Add documentation
Extensive doc comments were added to keybindings, CLI options, logging, and widget modules. The `count_largest_group` function was introduced to compute the largest group size among actions. CLI validation for `skill_points_limit` was broadened to a 90‑690 range. Imports and signatures for `Display` were adjusted accordingly.
This commit is contained in:
1 parent
9719e1ba6b
commit
6f17406d98
6 files changed
+156
-4
No files matched your search
+26
@@ -1,6 +1,32 @@
|
||||
use simplelog::{Config, LevelFilter, WriteLogger};
|
||||
use std::fs::File;
|
||||
|
||||
/// Initializes the global logger for the application.
|
||||
///
|
||||
/// This function creates (or truncates) a file called `war_in_tunnels.log`
|
||||
/// in the current working directory and configures a `simplelog::WriteLogger`
|
||||
/// to write log messages with a minimum level of `Info`.
|
||||
///
|
||||
/// # Panics
|
||||
///
|
||||
/// - If the log file cannot be created (e.g., due to permission issues).
|
||||
/// - If the logger cannot be initialized (which would indicate an internal
|
||||
/// error in the `simplelog` crate).
|
||||
///
|
||||
/// Call this once, preferably at the very beginning of `main()`, before any
|
||||
/// logging macros are used.
|
||||
///
|
||||
/// # Example
|
||||
///
|
||||
/// ```
|
||||
/// use war_in_tunnels::logs::init_logger;
|
||||
/// use log::info;
|
||||
///
|
||||
/// fn main() {
|
||||
/// init_logger();
|
||||
/// info!("Application started");
|
||||
/// }
|
||||
/// ```
|
||||
pub fn init_logger() {
|
||||
WriteLogger::init(
|
||||
LevelFilter::Info,
|
||||
|
||||
Reference in new issue
Block a user