Skip to content

Commit

Permalink
fix(cli): start logger only when needed (#634)
Browse files Browse the repository at this point in the history
  • Loading branch information
ematipico authored Oct 30, 2023
1 parent f58df06 commit 263a26f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ Read our [guidelines for writing a good changelog entry](https://github.com/biom

### CLI

#### Bug fixes

- Bootstrap the logger only when needed. Contributed by @ematipico

### Configuration

### Editors
Expand Down
5 changes: 4 additions & 1 deletion crates/biome_cli/src/logging.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ use tracing_subscriber::util::SubscriberInitExt;
use tracing_subscriber::{registry, Layer};

pub fn setup_cli_subscriber(level: LoggingLevel, kind: LoggingKind) {
if level == LoggingLevel::None {
return;
}
let format = tracing_subscriber::fmt::layer()
.with_level(true)
.with_target(false)
Expand Down Expand Up @@ -37,7 +40,7 @@ pub fn setup_cli_subscriber(level: LoggingLevel, kind: LoggingKind) {
};
}

#[derive(Debug, Default, Clone)]
#[derive(Debug, Default, Clone, Ord, PartialOrd, Eq, PartialEq)]
pub enum LoggingLevel {
/// No logs should be shown
#[default]
Expand Down
4 changes: 4 additions & 0 deletions website/src/content/docs/internals/changelog.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ Read our [guidelines for writing a good changelog entry](https://github.com/biom

### CLI

#### Bug fixes

- Bootstrap the logger only when needed. Contributed by @ematipico

### Configuration

### Editors
Expand Down

0 comments on commit 263a26f

Please sign in to comment.