diff options
author | Alan Conway <aconway@apache.org> | 2007-06-11 16:05:06 +0000 |
---|---|---|
committer | Alan Conway <aconway@apache.org> | 2007-06-11 16:05:06 +0000 |
commit | b59a0092f12a07f925bc0b1c7f8cf4949dd374e7 (patch) | |
tree | c6c188962552bac59bb96b8b7b00d791ae9e4be1 /cpp/src/qpid/Exception.cpp | |
parent | 4c88e1be1c96cf27b8418df2a60c3cbbefd92fcc (diff) | |
download | qpid-python-b59a0092f12a07f925bc0b1c7f8cf4949dd374e7.tar.gz |
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
Diffstat (limited to 'cpp/src/qpid/Exception.cpp')
-rw-r--r-- | cpp/src/qpid/Exception.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
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 <typeinfo> #include <errno.h> 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() {} |