Skip to content

Commit

Permalink
feat: remove environment variable BIOME_LOG_DIR (#4289)
Browse files Browse the repository at this point in the history
  • Loading branch information
ematipico committed Nov 27, 2024
1 parent 1be9494 commit 17ff3f6
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 14 deletions.
9 changes: 9 additions & 0 deletions .changeset/remove_biome_log_dir.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
cli: major
---

# Remove `BIOME_LOG_DIR`

The environment variable `BIOME_LOG_DIR` isn't supported anymore.

Use `BIOME_LOG_PATH` instead.
6 changes: 1 addition & 5 deletions crates/biome_cli/src/commands/daemon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -232,11 +232,7 @@ fn setup_tracing_subscriber(log_path: Option<PathBuf>, log_file_name_prefix: Opt
pub fn default_biome_log_path() -> PathBuf {
match env::var_os("BIOME_LOG_PATH") {
Some(directory) => PathBuf::from(directory),
// TODO: Remove in Biome v2, and use the None part as fallback.
None => match env::var_os("BIOME_LOG_DIR") {
Some(directory) => PathBuf::from(directory),
None => biome_fs::ensure_cache_dir().join("biome-logs"),
},
None => biome_fs::ensure_cache_dir().join("biome-logs"),
}
}

Expand Down
8 changes: 1 addition & 7 deletions crates/biome_cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//! to parse commands and arguments, redirect the execution of the commands and
//! execute the traversal of directory and files, based on the command that were passed.
use biome_console::{markup, ColorMode, Console, ConsoleExt};
use biome_console::{ColorMode, Console};
use biome_fs::OsFileSystem;
use biome_service::{App, DynRef, Workspace, WorkspaceRef};
use commands::search::SearchCommandPayload;
Expand Down Expand Up @@ -69,12 +69,6 @@ impl<'app> CliSession<'app> {
if has_metrics {
crate::metrics::init_metrics();
}
// TODO: remove in Biome v2
if env::var_os("BIOME_LOG_DIR").is_some() {
self.app.console.log(markup! {
<Warn>"The use of BIOME_LOG_DIR is deprecated. Use BIOME_LOG_PATH instead."</Warn>
});
}

let result = match command {
BiomeCommand::Version(_) => commands::version::full_version(self),
Expand Down
4 changes: 2 additions & 2 deletions crates/biome_cli/tests/commands/rage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -349,8 +349,8 @@ fn assert_rage_snapshot(payload: SnapshotPayload<'_>) {
.lines()
.map(|line| match line.trim_start().split_once(':') {
Some((
"CPU Architecture" | "OS" | "NO_COLOR" | "TERM" | "BIOME_LOG_DIR"
| "BIOME_LOG_PATH" | "Color support",
"CPU Architecture" | "OS" | "NO_COLOR" | "TERM" | "BIOME_LOG_PATH"
| "Color support",
value,
)) => line.replace(value.trim_start(), "**PLACEHOLDER**"),
_ => line.to_string(),
Expand Down

0 comments on commit 17ff3f6

Please sign in to comment.