set up logging level before privileges check (#143)

This commit is contained in:
deepakpjose
2026-01-30 22:33:54 +05:30
committed by GitHub
parent 889e537d02
commit c3dbce8462

View File

@@ -22,8 +22,6 @@ fn main() -> Result<()> {
// Parse command line arguments
let matches = cli::build_cli().get_matches();
// Check privileges BEFORE initializing TUI (so error messages are visible)
check_privileges_early()?;
// Set up logging only if log-level was provided
if let Some(log_level_str) = matches.get_one::<String>("log-level") {
let log_level = log_level_str
@@ -32,6 +30,9 @@ fn main() -> Result<()> {
setup_logging(log_level)?;
}
// Check privileges BEFORE initializing TUI (so error messages are visible)
check_privileges_early()?;
info!("Starting RustNet Monitor");
// Build configuration from command line arguments