[Libreoffice-commits] core.git: tools/source

Noel Grandin noel at peralex.com
Mon Jun 13 08:30:57 UTC 2016


 tools/source/debug/debug.cxx |   13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

New commits:
commit 27ecc40785b103297f0725928af1d98ffb856dc3
Author: Noel Grandin <noel at peralex.com>
Date:   Mon Jun 13 10:30:00 2016 +0200

    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

diff --git a/tools/source/debug/debug.cxx b/tools/source/debug/debug.cxx
index dafd60a..1f67a6f 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 );
             }
         }


More information about the Libreoffice-commits mailing list