Skip to content

Commit

Permalink
fix: allocation of default LogWriterConfig to reference
Browse files Browse the repository at this point in the history
  • Loading branch information
enigbe committed Jan 21, 2025
1 parent 2e9188a commit 322f97f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1288,7 +1288,8 @@ fn build_with_store_internal(

/// Sets up the node logger.
fn setup_logger(config_opt: &Option<LogWriterConfig>) -> Result<Arc<Logger>, BuildError> {
let config = if let Some(conf) = config_opt { conf } else { &LogWriterConfig::default() };
let default_config = LogWriterConfig::default();
let config = if let Some(conf) = config_opt { conf } else { &default_config };

let logger = match config {
LogWriterConfig::File(fs_logger_config) => {
Expand All @@ -1305,7 +1306,7 @@ fn setup_logger(config_opt: &Option<LogWriterConfig>) -> Result<Arc<Logger>, Bui
LogWriterConfig::Log(log_level) => Logger::new_log_facade(*log_level),

LogWriterConfig::Custom(custom_log_writer) => {
Logger::new_custom_writer(Arc::clone(custom_log_writer))
Logger::new_custom_writer(Arc::clone(&custom_log_writer))
},
};

Expand Down

0 comments on commit 322f97f

Please sign in to comment.