Commit 6da13de 1 parent f0a23f9 commit 6da13de Copy full SHA for 6da13de
File tree 2 files changed +13
-2
lines changed
2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,16 @@ pub mod github {
13
13
pub const CLIENT_ID : & str = "6652e5931c88e528a851" ;
14
14
}
15
15
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
+
16
26
pub const USER_AGENT : & str = concat ! ( env!( "CARGO_PKG_NAME" ) , "/" , env!( "CARGO_PKG_VERSION" ) ) ;
17
27
18
28
/// Number of entries to fetch
@@ -30,6 +40,6 @@ fn project_dirs() -> &'static ProjectDirs {
30
40
static PROJECT_DIRS : OnceLock < ProjectDirs > = OnceLock :: new ( ) ;
31
41
32
42
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" )
34
44
} )
35
45
}
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ use synd_term::{
6
6
auth,
7
7
cli:: { self , Args } ,
8
8
client:: Client ,
9
+ config,
9
10
terminal:: Terminal ,
10
11
ui:: theme:: Theme ,
11
12
} ;
@@ -44,7 +45,7 @@ fn init_tracing(log_path: Option<PathBuf>) -> anyhow::Result<Option<WorkerGuard>
44
45
. with_writer ( writer) ,
45
46
)
46
47
. with (
47
- EnvFilter :: try_from_default_env ( )
48
+ EnvFilter :: try_from_env ( config :: env :: LOG_DIRECTIVE )
48
49
. or_else ( |_| EnvFilter :: try_new ( "info" ) )
49
50
. unwrap ( ) ,
50
51
)
You can’t perform that action at this time.
0 commit comments