Skip to main content

init_logging

Function init_logging 

Source
pub fn init_logging(
    app_config: Option<&AppConfig>,
    target_crate: &str,
    working_dir: &PathBuf,
    additional_directives: &[&str],
)
Expand description

Initialize logging with optional app config and a target crate name.

Priority order:

  1. RUST_LOG environment variable (full control)
  2. app.log_level from config.toml (sets global level)
  3. Defaults to info for the target crate and warn for third-party crates

If app.log_file = true, logs are also written to: {working_dir}/.robit/logs/robit-YYYY-MM-DD.log (daily rotation)

§Arguments

  • app_config: Optional AppConfig from config.toml
  • target_crate: Name of the target crate (e.g. “robit_tui”, “robit_qq”)
  • working_dir: Working directory for the agent (where .robit/logs is created)
  • additional_directives: Optional additional Directives for specific crates