use env var for integration test log level
This commit is contained in:
parent
652cdda833
commit
cb0440be85
2 changed files with 8 additions and 1 deletions
3
.github/workflows/build.yml
vendored
3
.github/workflows/build.yml
vendored
|
@ -38,6 +38,9 @@ jobs:
|
|||
test:
|
||||
name: Test Suite
|
||||
runs-on: ${{ matrix.os }}
|
||||
env:
|
||||
RUST_BACKTRACE: 1
|
||||
HELIX_LOG_LEVEL: info
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v3
|
||||
|
|
|
@ -61,6 +61,10 @@ pub struct Application {
|
|||
|
||||
#[cfg(feature = "integration")]
|
||||
fn setup_integration_logging() {
|
||||
let level = std::env::var("HELIX_LOG_LEVEL")
|
||||
.map(|lvl| lvl.parse().unwrap())
|
||||
.unwrap_or(log::LevelFilter::Info);
|
||||
|
||||
// Separate file config so we can include year, month and day in file logs
|
||||
let _ = fern::Dispatch::new()
|
||||
.format(|out, message, record| {
|
||||
|
@ -72,7 +76,7 @@ fn setup_integration_logging() {
|
|||
message
|
||||
))
|
||||
})
|
||||
.level(log::LevelFilter::Debug)
|
||||
.level(level)
|
||||
.chain(std::io::stdout())
|
||||
.apply();
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue