return it->second;
}
-void ApplyRule::CheckMatches()
+void ApplyRule::CheckMatches(bool silent)
{
for (const RuleMap::value_type& kv : m_Rules) {
for (const ApplyRule& rule : kv.second) {
- if (!rule.HasMatches())
+ if (!rule.HasMatches() && !silent)
Log(LogWarning, "ApplyRule")
<< "Apply rule '" << rule.GetName() << "' (" << rule.GetDebugInfo() << ") for type '" << kv.first << "' does not match anywhere!";
}
static bool IsValidTargetType(const String& sourceType, const String& targetType);
static std::vector<String> GetTargetTypes(const String& sourceType);
- static void CheckMatches();
+ static void CheckMatches(bool silent);
private:
String m_TargetType;
std::vector<ConfigItem::Ptr> newItems;
- if (!ConfigItem::CommitItems(ascope.GetContext(), upq, newItems) || !ConfigItem::ActivateItems(upq, newItems, true)) {
+ /* Disable logging for object creation, but do so ourselves later on. */
+ if (!ConfigItem::CommitItems(ascope.GetContext(), upq, newItems, true) || !ConfigItem::ActivateItems(upq, newItems, true, true)) {
if (errors) {
if (unlink(path.CStr()) < 0 && errno != ENOENT) {
BOOST_THROW_EXCEPTION(posix_error()
}
ApiListener::UpdateObjectAuthority();
+
+ Log(LogInformation, "ConfigObjectUtility")
+ << "Created and activated object '" << fullName << "' of type '" << type->GetName() << "'.";
+
} catch (const std::exception& ex) {
if (unlink(path.CStr()) < 0 && errno != ENOENT) {
BOOST_THROW_EXCEPTION(posix_error()