diff options
author | Dwayne Boone <dwayne@zeroc.com> | 2009-08-21 16:17:16 -0230 |
---|---|---|
committer | Dwayne Boone <dwayne@zeroc.com> | 2009-08-21 16:17:16 -0230 |
commit | 33dc83b94215d845ba75b2cd299aa3b64f06fdfc (patch) | |
tree | 9b65727c9b89b84ee722b37308de819024bd88d1 /cpp/src/Ice/LoggerUtil.cpp | |
parent | removing references to IceInternal.SelectorHandler from proguard configs (diff) | |
download | ice-33dc83b94215d845ba75b2cd299aa3b64f06fdfc.tar.bz2 ice-33dc83b94215d845ba75b2cd299aa3b64f06fdfc.tar.xz ice-33dc83b94215d845ba75b2cd299aa3b64f06fdfc.zip |
Bug 2664 - Added Ice.PrintStackTraces and cleaned up ifdefs
Diffstat (limited to 'cpp/src/Ice/LoggerUtil.cpp')
-rw-r--r-- | cpp/src/Ice/LoggerUtil.cpp | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/cpp/src/Ice/LoggerUtil.cpp b/cpp/src/Ice/LoggerUtil.cpp index b1cec4f8fc4..2b92afe037a 100644 --- a/cpp/src/Ice/LoggerUtil.cpp +++ b/cpp/src/Ice/LoggerUtil.cpp @@ -16,6 +16,13 @@ using namespace std; +namespace IceInternal +{ + +bool printStackTraces = false; + +} + ostringstream& Ice::LoggerOutputBase::__str() { @@ -33,11 +40,14 @@ Ice::LoggerOutputBase& Ice::operator<<(Ice::LoggerOutputBase& out, const std::exception& ex) { #ifdef __GNUC__ - const ::IceUtil::Exception* exception = dynamic_cast<const ::IceUtil::Exception*>(&ex); - if(exception) + if(IceInternal::printStackTraces) { - out.__str() << exception->what() << '\n' << exception->ice_stackTrace(); - return out; + const ::IceUtil::Exception* exception = dynamic_cast<const ::IceUtil::Exception*>(&ex); + if(exception) + { + out.__str() << exception->what() << '\n' << exception->ice_stackTrace(); + return out; + } } #endif out.__str() << ex.what(); |