]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[1944] Make sure we print the message ID on abort
authorMichal 'vorner' Vaner <michal.vaner@nic.cz>
Thu, 24 May 2012 12:30:54 +0000 (14:30 +0200)
committerMichal 'vorner' Vaner <michal.vaner@nic.cz>
Fri, 25 May 2012 11:18:24 +0000 (13:18 +0200)
When we enable the strict log checking and the excess placeholders check
triggers, we need to print the message to easily identify the message ID
with the problem.

src/lib/log/log_formatter.cc

index c728cb5dd31625a23d15a14702e35aa79b9f3b5a..9cd5cc77b4791cbe97c045a42cb9f5183fb0e26f 100644 (file)
 
 #include <cassert>
 
+#ifdef ENABLE_LOGGER_CHECKS
+#include <iostream>
+#endif
+
 using namespace std;
 using namespace boost;
 
@@ -59,6 +63,9 @@ checkExcessPlaceholders(string* message, unsigned int placeholder) {
         // but we can't at least for now because this function is called from
         // the Formatter's destructor.
 #ifdef ENABLE_LOGGER_CHECKS
+        // Also, make sure we print the message so we can identify which
+        // identifier has the problem.
+        cerr << "Message " << *message << endl;
         assert("Excess logger placeholders still exist in message" == NULL);
 #else
         message->append(" @@Excess logger placeholders still exist@@");