Date: prev next · Thread: first prev next last
2013 Archives by date, by thread · List index


Hi,

I have submitted a patch for review:

    https://gerrit.libreoffice.org/3421

To pull it, you can do:

    git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/21/3421/1

forward RTL_CONTEXT_foo logging to SAL_INFO in default debugging

* RTL_CONTEXT_foo is originally intended to be used for performance
  measurement, but mostly unused right now
* however its macros are sprinkled all over the codebase and might
  provide good help for ad-hoc debugging, and prevent SAL_INFO
  duplication
* if there is no performance logging, these macros are now forwarded to
  SAL_INFO with logarea "logfile" or "$AREA.logfile"

Change-Id: I495c8924e5b55124f7eac68eccda074d0740c117
---
M sal/inc/rtl/logfile.hxx
1 file changed, 15 insertions(+), 3 deletions(-)



diff --git a/sal/inc/rtl/logfile.hxx b/sal/inc/rtl/logfile.hxx
index 5ee0739..e29c4af 100644
--- a/sal/inc/rtl/logfile.hxx
+++ b/sal/inc/rtl/logfile.hxx
@@ -21,6 +21,8 @@
 
 #include <rtl/logfile.h>
 #include <rtl/string.hxx>
+#include <rtl/strbuf.hxx>
+#include <sal/log.hxx>
 
 namespace rtl
 {
@@ -161,9 +163,19 @@
         rtl_logfile_trace( "\n" )
 
 #else
-#define RTL_LOGFILE_CONTEXT( instance, name )  ((void)0)
-#define RTL_LOGFILE_CONTEXT_AUTHOR( instance, project, author, name )  ((void)0)
-#define RTL_LOGFILE_CONTEXT_TRACE( instance, message )  ((void)0)
+#define RTL_LOGFILE_FORWARD_VIA_SAL_LOG(area, message) \
+    do { \
+        OStringBuffer full_area; \
+        full_area.append(OString(area)); \
+        if(full_area.getLength()) \
+            full_area.append("."); \
+        full_area.append(OString("logfile")); \
+        SAL_INFO(full_area.makeStringAndClear().getStr(), message); \
+    } while (false)
+
+#define RTL_LOGFILE_CONTEXT( instance, name )  RTL_LOGFILE_FORWARD_VIA_SAL_LOG("", name)
+#define RTL_LOGFILE_CONTEXT_AUTHOR( instance, project, author, name )  
RTL_LOGFILE_FORWARD_VIA_SAL_LOG(project, name)
+#define RTL_LOGFILE_CONTEXT_TRACE( instance, message )  RTL_LOGFILE_FORWARD_VIA_SAL_LOG("", 
message)
 #define RTL_LOGFILE_CONTEXT_TRACE1( instance, frmt, arg1 ) ((void)arg1,(void)0)
 #define RTL_LOGFILE_CONTEXT_TRACE2( instance, frmt, arg1, arg2 ) ((void)arg1,(void)arg2,(void)0)
 #define RTL_LOGFILE_CONTEXT_TRACE3( instance, frmt, arg1, arg2 , arg3 ) 
((void)arg1,(void)arg2,(void)arg3,(void)0)

-- 
To view, visit https://gerrit.libreoffice.org/3421
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I495c8924e5b55124f7eac68eccda074d0740c117
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Björn Michaelsen <bjoern.michaelsen@canonical.com>


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.