@@ -12,8 +12,7 @@ use registry_helper::RegistryHelper;
12
12
use schemars:: schema_for;
13
13
use std:: process:: exit;
14
14
use tracing:: { debug, error} ;
15
- use tracing_subscriber:: { EnvFilter , Layer , prelude:: __tracing_subscriber_SubscriberExt} ;
16
-
15
+ use tracing_subscriber:: { filter:: LevelFilter , prelude:: __tracing_subscriber_SubscriberExt, EnvFilter , Layer } ;
17
16
use crate :: config:: Registry ;
18
17
19
18
mod args;
@@ -49,6 +48,7 @@ fn main() {
49
48
args:: SubCommand :: Config { subcommand } => {
50
49
match subcommand {
51
50
args:: ConfigSubCommand :: Get { input} => {
51
+ debug ! ( "Get input: {input}" ) ;
52
52
let reg_helper = match RegistryHelper :: new ( & input) {
53
53
Ok ( reg_helper) => reg_helper,
54
54
Err ( err) => {
@@ -68,6 +68,7 @@ fn main() {
68
68
}
69
69
} ,
70
70
args:: ConfigSubCommand :: Set { input, what_if} => {
71
+ debug ! ( "Set input: {input}, what_if: {what_if}" ) ;
71
72
let mut reg_helper = match RegistryHelper :: new ( & input) {
72
73
Ok ( reg_helper) => reg_helper,
73
74
Err ( err) => {
@@ -92,6 +93,7 @@ fn main() {
92
93
}
93
94
} ,
94
95
args:: ConfigSubCommand :: Delete { input} => {
96
+ debug ! ( "Delete input: {input}" ) ;
95
97
let reg_helper = match RegistryHelper :: new ( & input) {
96
98
Ok ( reg_helper) => reg_helper,
97
99
Err ( err) => {
@@ -120,9 +122,8 @@ fn main() {
120
122
}
121
123
122
124
pub fn enable_tracing ( ) {
123
- let filter = EnvFilter :: try_from_default_env ( )
124
- . or_else ( |_| EnvFilter :: try_new ( "trace" ) )
125
- . unwrap_or_default ( ) ;
125
+ // default filter to trace level
126
+ let filter = EnvFilter :: builder ( ) . with_default_directive ( LevelFilter :: TRACE . into ( ) ) . parse ( "" ) . unwrap ( ) ;
126
127
let layer = tracing_subscriber:: fmt:: Layer :: default ( ) . with_writer ( std:: io:: stderr) ;
127
128
let fmt = layer
128
129
. with_ansi ( false )
0 commit comments