init_file_only_logging

Function init_file_only_logging 

Source
pub fn init_file_only_logging(component_name: &str) -> Result<PathBuf>
Expand description

Initialize file-only logging for TUI applications

This function sets up logging that only writes to a file, not to stdout/stderr. This is essential for TUI applications that need full control over the terminal.

§Arguments

  • component_name - Name of the component (e.g., “edb-tui”)

§Returns

  • Result<PathBuf> - The path to the log file on success

§Examples

use edb_common::logging;

#[tokio::main]
async fn main() -> eyre::Result<()> {
    // Initialize file-only logging for TUI
    let log_path = logging::init_file_only_logging("edb-tui")?;
    eprintln!("Logs are being written to: {}", log_path.display());
     
    tracing::info!("TUI started");
    Ok(())
}