Refactor logging configuration and streamline command execution in tests

- Updated the main function to conditionally disable file logging based on the `ATLAS_NO_FILE_LOG` environment variable, enhancing flexibility in logging behavior.
- Introduced a new `atlas_command` function to encapsulate command creation for tests, ensuring consistent command execution across various test files.
- Replaced direct usage of `ROJO_PATH` with `atlas_command` in multiple test utilities, improving code clarity and maintainability.

These changes aim to enhance the logging setup and simplify command handling in the test suite.
This commit is contained in:
Joe 2026-03-01 14:41:51 -06:00
parent c0f5a01e17
commit 380041dc2a
7 changed files with 35 additions and 27 deletions

View file

@ -55,10 +55,14 @@ fn main() {
let project_dir = options.subcommand.project_path().map(resolve_project_dir);
let file_log_level = project_dir
.as_deref()
.and_then(logging::quick_read_file_log_level)
.unwrap_or(Some(tracing::level_filters::LevelFilter::TRACE));
let file_log_level = if env::var("ATLAS_NO_FILE_LOG").is_ok() {
None
} else {
project_dir
.as_deref()
.and_then(logging::quick_read_file_log_level)
.unwrap_or(Some(tracing::level_filters::LevelFilter::TRACE))
};
let command_name = format!("atlas-{}", options.subcommand.command_name());