summaryrefslogtreecommitdiffhomepage
path: root/src/log.rs
Commit message (Collapse)AuthorAgeFilesLines
* log: add debug!/info!/warn!/error! macros and refactor to use itdilluti0n2026-03-021-4/+27
|
* log: add short form log macroshskimse2026-03-021-0/+5
|
* log: defer local_time() call until log level check passesdilluti0n2026-02-261-1/+1
|
* log: add defensive error handling for local_timedilluti0n2026-02-161-1/+3
| | | | Fallback to zeroed timestamp when time()/localtime_r() fails.
* log: drop chrono, use localtime_r and GetLocalTime directlydilluti0n2026-02-161-2/+27
| | | | 24 KiB is precious :)
* log: print time with crate chronodilluti0n2026-02-161-1/+2
|
* Refactor main.rs; modulize opt.rs and pkt.rsdilluti0n2026-01-161-26/+3
| | | | | Move option parsing to opt.rs and packet handling to pkt.rs from main.rs
* log: add splash! macro and centralize no-splash handlingdilluti0n2025-09-071-4/+19
| | | | | | | | | | | | | * Introduce: `splash!` macro in `log.rs` to print startup messages conditionally, based on `--no-splash` flag. * Move: `NO_SPLASH` management into `log.rs` with helper functions: (`set_no_splash`, `no_splash`). * Remove: old `splash()` function in `main.rs` and replace with `splash!` macro usage. * Set: default `LogLevel` according to build profile (Debug → Debug, Release → Warning). * Print: unified startup messages across Linux and Windows, including `MESSAGE_AT_RUN`.
* Update copyright notices to notice email instead of github linkdilluti0n2025-09-051-1/+1
|
* Add license document and copyright notice headersdilluti0n2025-09-051-0/+17
|
* log: update error messagedilluti0n2025-09-051-1/+1
|
* Add flag --loglevel to set loglevel on runtimedilluti0n2025-09-031-7/+41
| | | | | | | | | | | | | | | * Introduce: `DEFAULT_LOG_LEVEL` and `LOG_LEVEL_OVERRIDE` (OnceLock) in log.rs. * Add: `set_log_level()` and `current_log_level()`; gate defaults by `debug_assertions`. * Implement: `FromStr` for `LogLevel` with a proper error type (`ParseLogLevelError`). * Update: `log_println!` to respect `current_log_level()` and use `format_args!`. * Extend: CLI: `--loglevel <debug|info|warning|error>` and reflect it in `usage()`. * Replace: ad-hoc prints with `log_println!` and plumb parsed level into `set_log_level`.
* Tidy up LogLevel enum definitiondilluti0n2025-09-031-3/+1
| | | | | | * Remove: unused `Fatal` variant from `LogLevel`. * Update: comment on `Error` to indicate it represents unrecoverable errors.
* Use log.rs for conditional logging and centralized error reportingdilluti0n2025-09-031-0/+5
| | | | | | | | | * Set: `LOG_LEVEL` to `Debug` in debug builds and `Warning` in release builds via `#[cfg(debug_assertions)]`. * Replace: direct `println!` calls with `log_println!` for packet handling, warning messages, and argument parsing errors. * Ensures: consistent log formatting and respects the global log level configuration across the codebase.
* Implement log.rs; log level handlingdilluti0n2025-09-031-0/+34