summaryrefslogtreecommitdiff
path: root/cpp/src/Ice/LoggerUtil.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/Ice/LoggerUtil.cpp')
-rw-r--r--cpp/src/Ice/LoggerUtil.cpp18
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();