@@ -12,8 +12,7 @@ use registry_helper::RegistryHelper;
1212use schemars:: schema_for;
1313use std:: process:: exit;
1414use 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 } ;
1716use crate :: config:: Registry ;
1817
1918mod args;
@@ -49,6 +48,7 @@ fn main() {
4948 args:: SubCommand :: Config { subcommand } => {
5049 match subcommand {
5150 args:: ConfigSubCommand :: Get { input} => {
51+ debug ! ( "Get input: {input}" ) ;
5252 let reg_helper = match RegistryHelper :: new ( & input) {
5353 Ok ( reg_helper) => reg_helper,
5454 Err ( err) => {
@@ -68,6 +68,7 @@ fn main() {
6868 }
6969 } ,
7070 args:: ConfigSubCommand :: Set { input, what_if} => {
71+ debug ! ( "Set input: {input}, what_if: {what_if}" ) ;
7172 let mut reg_helper = match RegistryHelper :: new ( & input) {
7273 Ok ( reg_helper) => reg_helper,
7374 Err ( err) => {
@@ -92,6 +93,7 @@ fn main() {
9293 }
9394 } ,
9495 args:: ConfigSubCommand :: Delete { input} => {
96+ debug ! ( "Delete input: {input}" ) ;
9597 let reg_helper = match RegistryHelper :: new ( & input) {
9698 Ok ( reg_helper) => reg_helper,
9799 Err ( err) => {
@@ -120,9 +122,8 @@ fn main() {
120122}
121123
122124pub 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 ( ) ;
126127 let layer = tracing_subscriber:: fmt:: Layer :: default ( ) . with_writer ( std:: io:: stderr) ;
127128 let fmt = layer
128129 . with_ansi ( false )
0 commit comments