]> granicus.if.org Git - icinga2/commitdiff
Disable stack traces for WQ exceptions (used in config compiler) 7251/head
authorMichael Friedrich <michael.friedrich@icinga.com>
Wed, 19 Jun 2019 12:26:34 +0000 (14:26 +0200)
committerMichael Friedrich <michael.friedrich@icinga.com>
Wed, 19 Jun 2019 12:26:34 +0000 (14:26 +0200)
The ConfigItem class collects exceptions and reports them.
In contrast to our other DiagnosticInformation() calls,
verbosity is enabled any time.

This patch allows to re-enable the verbose output including
the stack traces, but disables this by default.

lib/base/workqueue.cpp
lib/base/workqueue.hpp

index 99bb50927d3da3d9a1de44e20dfa40cc4819f36c..cacd17b7667845e0e4676626b3a550e0bbcea5b5 100644 (file)
@@ -169,13 +169,13 @@ std::vector<boost::exception_ptr> WorkQueue::GetExceptions() const
        return m_Exceptions;
 }
 
-void WorkQueue::ReportExceptions(const String& facility) const
+void WorkQueue::ReportExceptions(const String& facility, bool verbose) const
 {
        std::vector<boost::exception_ptr> exceptions = GetExceptions();
 
        for (const auto& eptr : exceptions) {
                Log(LogCritical, facility)
-                       << DiagnosticInformation(eptr);
+                       << DiagnosticInformation(eptr, verbose);
        }
 
        Log(LogCritical, facility)
index 824d2e8243f42f1ab99b8c8fc513c49d56f79b9a..bc84d917640398965f01b41f157786e71a1482c6 100644 (file)
@@ -103,7 +103,7 @@ public:
 
        bool HasExceptions() const;
        std::vector<boost::exception_ptr> GetExceptions() const;
-       void ReportExceptions(const String& facility) const;
+       void ReportExceptions(const String& facility, bool verbose = false) const;
 
 protected:
        void IncreaseTaskCount();