@@ -112,7 +112,7 @@ impl Default for LiquiditySourceConfig {
112112#[ derive( Clone ) ]
113113enum LogWriterConfig {
114114 File { log_file_path : Option < String > , max_log_level : Option < LogLevel > } ,
115- Log ( LogLevel ) ,
115+ Log { max_log_level : Option < LogLevel > } ,
116116 Custom ( Arc < dyn LogWriter > ) ,
117117}
118118
@@ -124,7 +124,7 @@ impl std::fmt::Debug for LogWriterConfig {
124124 . field ( "max_log_level" , max_log_level)
125125 . field ( "log_file_path" , log_file_path)
126126 . finish ( ) ,
127- LogWriterConfig :: Log ( max_log_level) => {
127+ LogWriterConfig :: Log { max_log_level } => {
128128 f. debug_tuple ( "Log" ) . field ( max_log_level) . finish ( )
129129 } ,
130130 LogWriterConfig :: Custom ( _) => {
@@ -349,8 +349,8 @@ impl NodeBuilder {
349349 ///
350350 /// If set, the `max_log_level` sets the maximum log level. Otherwise, the latter defaults to
351351 /// [`DEFAULT_LOG_LEVEL`].
352- pub fn set_log_facade_logger ( & mut self , max_log_level : LogLevel ) -> & mut Self {
353- self . log_writer_config = Some ( LogWriterConfig :: Log ( max_log_level) ) ;
352+ pub fn set_log_facade_logger ( & mut self , max_log_level : Option < LogLevel > ) -> & mut Self {
353+ self . log_writer_config = Some ( LogWriterConfig :: Log { max_log_level } ) ;
354354 self
355355 }
356356
@@ -680,7 +680,7 @@ impl ArcedNodeBuilder {
680680 ///
681681 /// If set, the `max_log_level` sets the maximum log level. Otherwise, the latter defaults to
682682 /// [`DEFAULT_LOG_LEVEL`].
683- pub fn set_log_facade_logger ( & self , log_level : LogLevel ) {
683+ pub fn set_log_facade_logger ( & self , log_level : Option < LogLevel > ) {
684684 self . inner . write ( ) . unwrap ( ) . set_log_facade_logger ( log_level) ;
685685 }
686686
@@ -1326,7 +1326,10 @@ fn setup_logger(
13261326 Logger :: new_fs_writer ( log_file_path, max_log_level)
13271327 . map_err ( |_| BuildError :: LoggerSetupFailed ) ?
13281328 } ,
1329- Some ( LogWriterConfig :: Log ( log_level) ) => Logger :: new_log_facade ( * log_level) ,
1329+ Some ( LogWriterConfig :: Log { max_log_level } ) => {
1330+ let max_log_level = max_log_level. unwrap_or_else ( || DEFAULT_LOG_LEVEL ) ;
1331+ Logger :: new_log_facade ( max_log_level)
1332+ } ,
13301333
13311334 Some ( LogWriterConfig :: Custom ( custom_log_writer) ) => {
13321335 Logger :: new_custom_writer ( Arc :: clone ( & custom_log_writer) )
0 commit comments