From b59a0092f12a07f925bc0b1c7f8cf4949dd374e7 Mon Sep 17 00:00:00 2001 From: Alan Conway Date: Mon, 11 Jun 2007 16:05:06 +0000 Subject: QPID-504: Print bound port if --port 0 is specified. Not yet used by tests. * qpidd.cpp: - With --port 0 print the bound port number to stdout. - Removed --ppid, --check now prints pid. * Daemon.cpp/h: Move pid-file generation to caller (qpidd.cpp) * Exception.cpp: Log a debug message in exception constructors. Helps to show what exceptions were thrown even if they aren't logged at a higher level. * daemon_test: Test new daemon options. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@546180 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/Exception.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'cpp/src/qpid/Exception.cpp') diff --git a/cpp/src/qpid/Exception.cpp b/cpp/src/qpid/Exception.cpp index e73f64f2ba..f4eeb7931b 100644 --- a/cpp/src/qpid/Exception.cpp +++ b/cpp/src/qpid/Exception.cpp @@ -19,7 +19,9 @@ * */ +#include "qpid/log/Statement.h" #include "Exception.h" +#include #include namespace qpid { @@ -28,12 +30,17 @@ std::string strError(int err) { char buf[512]; return std::string(strerror_r(err, buf, sizeof(buf))); } + +static void ctorLog(const std::exception* e) { + QPID_LOG(trace, "Exception constructor " << typeid(e).name() << ": " << e->what()); +} -Exception::Exception() throw() {} +Exception::Exception() throw() { ctorLog(this); } -Exception::Exception(const std::string& str) throw() : whatStr(str) {} +Exception::Exception(const std::string& str) throw() + : whatStr(str) { ctorLog(this); } -Exception::Exception(const char* str) throw() : whatStr(str) {} +Exception::Exception(const char* str) throw() : whatStr(str) { ctorLog(this); } Exception::~Exception() throw() {} -- cgit v1.2.1