diff --git a/src/game.rs b/src/game.rs index eda8ecb0..13cf9c4d 100644 --- a/src/game.rs +++ b/src/game.rs @@ -686,17 +686,21 @@ fn try_load_plugin( ) -> Option { let resolved_path = resolve_plugin_path(game_type, data_path, plugin_path); - match Plugin::new(game_type, game_cache, &resolved_path, load_scope) { - Ok(p) => Some(p), - Err(e) => { + Plugin::new(game_type, game_cache, &resolved_path, load_scope) + .inspect(|_| { + logging::debug!( + "Successfully loaded the plugin at \"{}\"", + escape_ascii(plugin_path) + ); + }) + .inspect_err(|e| { logging::error!( "Caught error while trying to load \"{}\": {}", escape_ascii(plugin_path), format_details(&e) ); - None - } - } + }) + .ok() } fn resolve_plugin_path(game_type: GameType, data_path: &Path, plugin_path: &Path) -> PathBuf { diff --git a/src/plugin/mod.rs b/src/plugin/mod.rs index 045c1907..b034a0a7 100644 --- a/src/plugin/mod.rs +++ b/src/plugin/mod.rs @@ -291,7 +291,7 @@ pub(crate) fn validate_plugin_path_and_header( Ok(()) } else if !has_plugin_file_extension(game_type, plugin_path) { logging::debug!( - "The file \"{}\" is not a valid plugin", + "The file \"{}\" is not a valid plugin, as it has an unsupported file extension", escape_ascii(plugin_path) ); Err(PluginValidationError::invalid( @@ -303,7 +303,7 @@ pub(crate) fn validate_plugin_path_and_header( Ok(()) } else { logging::debug!( - "The file \"{}\" is not a valid plugin", + "The file \"{}\" is not a valid plugin, as it has an invalid header", escape_ascii(plugin_path) ); Err(PluginValidationError::new(