From 27ecc40785b103297f0725928af1d98ffb856dc3 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Mon, 13 Jun 2016 10:30:00 +0200 Subject: [PATCH] improve formatting of DBG_UNHANDLED_EXCEPTION message put more useful info on the same line, and indent following lines, to visually separate them from new log messages. Change-Id: Ieda71aebf68420a0521ce98c621b0236d533bc53 --- tools/source/debug/debug.cxx | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/tools/source/debug/debug.cxx b/tools/source/debug/debug.cxx index dafd60a74d59..1f67a6fa946c 100644 --- a/tools/source/debug/debug.cxx +++ b/tools/source/debug/debug.cxx @@ -78,22 +78,21 @@ void DbgTestSolarMutex() void DbgUnhandledException(const css::uno::Any & caught, const char* currentFunction, const char* fileAndLineNo) { - OString sMessage( "caught an exception!" ); - sMessage += "\nin function:"; + OString sMessage( "DBG_UNHANDLED_EXCEPTION in " ); sMessage += currentFunction; - sMessage += "\ntype: "; + sMessage += "\n type: "; sMessage += OUStringToOString( caught.getValueTypeName(), osl_getThreadTextEncoding() ); css::uno::Exception exception; caught >>= exception; if ( !exception.Message.isEmpty() ) { - sMessage += "\nmessage: "; + sMessage += "\n message: "; sMessage += OUStringToOString( exception.Message, osl_getThreadTextEncoding() ); } if ( exception.Context.is() ) { const char* pContext = typeid( *exception.Context.get() ).name(); - sMessage += "\ncontext: "; + sMessage += "\n context: "; sMessage += pContext; } { @@ -101,7 +100,7 @@ void DbgUnhandledException(const css::uno::Any & caught, const char* currentFunc specialized; if ( caught >>= specialized ) { - sMessage += "\ndetails: "; + sMessage += "\n details: "; sMessage += OUStringToOString( specialized.Details, osl_getThreadTextEncoding() ); } @@ -110,7 +109,7 @@ void DbgUnhandledException(const css::uno::Any & caught, const char* currentFunc css::task::ErrorCodeIOException specialized; if ( caught >>= specialized ) { - sMessage += "\ndetails: "; + sMessage += "\n details: "; sMessage += OString::number( specialized.ErrCode ); } }