From f788795415b9735f994c2169303b2bc2d95d4c13 Mon Sep 17 00:00:00 2001 From: Peter Eckel Date: Sun, 29 Jul 2018 15:08:12 +0200 Subject: [PATCH] Reduce the log level for missing env macros to debug refs #6460 --- lib/icinga/pluginutility.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/icinga/pluginutility.cpp b/lib/icinga/pluginutility.cpp index 0dcc70997..47ff52eb9 100644 --- a/lib/icinga/pluginutility.cpp +++ b/lib/icinga/pluginutility.cpp @@ -70,10 +70,17 @@ void PluginUtility::ExecuteCommand(const Command::Ptr& commandObj, const Checkab for (const Dictionary::Pair& kv : env) { String name = kv.second; + String missingMacro; Value value = MacroProcessor::ResolveMacros(name, macroResolvers, cr, - nullptr, MacroProcessor::EscapeCallback(), resolvedMacros, + &missingMacro, MacroProcessor::EscapeCallback(), resolvedMacros, useResolvedMacros); +#ifdef I2_DEBUG + if (!missingMacro.IsEmpty()) + Log(LogDebug, "PluginUtility") + << "Macro '" << name << "' is not defined."; +#endif /* I2_DEBUG */ + if (value.IsObjectType()) value = Utility::Join(value, ';');