From 50e19da6967dcab04c7adbe51264c0f09d4a0124 Mon Sep 17 00:00:00 2001 From: Ewoud Kohl van Wijngaarden Date: Mon, 1 Jul 2024 12:02:50 +0200 Subject: [PATCH] Log module loading warning to stderr When requesting output as JSON the warnings on stdout will prevent loading. It also fixes a typo in occurred. --- lib/hammer_cli/modules.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/hammer_cli/modules.rb b/lib/hammer_cli/modules.rb index 5501100e..ef479d68 100644 --- a/lib/hammer_cli/modules.rb +++ b/lib/hammer_cli/modules.rb @@ -54,7 +54,7 @@ def self.load!(name) require_module(name) rescue Exception => e logger.error "Error while loading module #{name}." - puts _("Warning: An error occured while loading module %s.") % name + $stderr.puts _("Warning: An error occurred while loading module %s.") % name # with ModuleLoadingError we assume the error is already logged by the issuer logger.error e unless e.is_a?(HammerCLI::ModuleLoadingError) raise e