Skip to content

Commit c67733a

Browse files
committed
fix: dev
1 parent 7a3fad1 commit c67733a

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

.github/workflows/ci-test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ jobs:
1717
env:
1818
ZERV_TEST_NATIVE_GIT: true
1919
ZERV_TEST_DOCKER: ${{ matrix.os == 'ubuntu-latest' && 'true' || 'false' }}
20+
FORCE_RUST_LOG_OFF: ${{ matrix.os == 'ubuntu-latest' && '1' || '' }}
2021
steps:
2122
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
2223
with:

src/config.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ impl EnvVars {
1515
/// See [tracing documentation](https://docs.rs/tracing-subscriber/latest/tracing_subscriber/filter/struct.EnvFilter.html)
1616
pub const RUST_LOG: &'static str = "RUST_LOG";
1717

18+
/// Force logging off for CI environments (Ubuntu CI).
19+
///
20+
/// When set to any value, all logging is disabled regardless of RUST_LOG setting.
21+
/// Used specifically to prevent debug log spam in Ubuntu CI.
22+
pub const FORCE_RUST_LOG_OFF: &'static str = "FORCE_RUST_LOG_OFF";
23+
1824
/// Use native Git instead of Docker Git for tests (default: false).
1925
///
2026
/// Set to `true` or `1` to enable native Git in test environments.

src/logging.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,11 @@ use crate::config::EnvVars;
1616
/// 2. --verbose flag - enables debug level
1717
/// 3. Default - error level only (Rust standard)
1818
pub fn init_logging(verbose: bool) {
19-
let filter = if let Ok(_rust_log) = std::env::var(EnvVars::RUST_LOG) {
20-
// EnvFilter::new(rust_log)
19+
let filter = if std::env::var(EnvVars::FORCE_RUST_LOG_OFF).is_ok() {
20+
// Force logging off for CI environments
2121
EnvFilter::new("off")
22+
} else if let Ok(rust_log) = std::env::var(EnvVars::RUST_LOG) {
23+
EnvFilter::new(rust_log)
2224
} else if verbose {
2325
EnvFilter::new("zerv=debug")
2426
} else {

0 commit comments

Comments
 (0)