Skip to content

Commit 6da13de

Browse files
committed
feat(term): change log directive env key
1 parent f0a23f9 commit 6da13de

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

crates/synd_term/src/config.rs

+11-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,16 @@ pub mod github {
1313
pub const CLIENT_ID: &str = "6652e5931c88e528a851";
1414
}
1515

16+
pub mod env {
17+
macro_rules! env_key {
18+
($key:expr) => {
19+
concat!("SYND", "_", $key)
20+
};
21+
}
22+
/// Log directive
23+
pub const LOG_DIRECTIVE: &str = env_key!("LOG");
24+
}
25+
1626
pub const USER_AGENT: &str = concat!(env!("CARGO_PKG_NAME"), "/", env!("CARGO_PKG_VERSION"));
1727

1828
/// Number of entries to fetch
@@ -30,6 +40,6 @@ fn project_dirs() -> &'static ProjectDirs {
3040
static PROJECT_DIRS: OnceLock<ProjectDirs> = OnceLock::new();
3141

3242
PROJECT_DIRS.get_or_init(|| {
33-
ProjectDirs::from("io", "ymgyt", "syndterm").expect("Failed to get project dirs")
43+
ProjectDirs::from("io", "ymgyt", "synd").expect("Failed to get project dirs")
3444
})
3545
}

crates/synd_term/src/main.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ use synd_term::{
66
auth,
77
cli::{self, Args},
88
client::Client,
9+
config,
910
terminal::Terminal,
1011
ui::theme::Theme,
1112
};
@@ -44,7 +45,7 @@ fn init_tracing(log_path: Option<PathBuf>) -> anyhow::Result<Option<WorkerGuard>
4445
.with_writer(writer),
4546
)
4647
.with(
47-
EnvFilter::try_from_default_env()
48+
EnvFilter::try_from_env(config::env::LOG_DIRECTIVE)
4849
.or_else(|_| EnvFilter::try_new("info"))
4950
.unwrap(),
5051
)

0 commit comments

Comments
 (0)