Bug 52780 - improved logging via libsynthesis
Summary: improved logging via libsynthesis
Status: RESOLVED MOVED
Alias: None
Product: SyncEvolution
Classification: Unclassified
Component: SyncEvolution (show other bugs)
Version: unspecified
Hardware: All All
: medium enhancement
Assignee: SyncEvolution Community
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-13 20:24 UTC by SyncEvolution Community
Modified: 2018-10-13 12:45 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Patrick Ohly 2012-07-29 18:36:00 UTC


---- Reported by jingke.zhang@intel.com 2010-04-13 20:24:28 +0000 ----

This is from http://bugzilla.moblin.org/show_bug.cgi?id=8264

   Description  From  pohly   2009-11-26 06:33:54 PST   (-) [reply]

There is a tentative new libsynthesis API call which allows users to pass more
information into the logging:

/**
 * @param aFile        source file name from which log entry comes
 * @param aLine        source file line
 * @param aFunction    function name
 * @param aDbgLevel    same bit mask as in the internal TDebugLogger;
 *                     currently DBG_HOT and DBG_ERROR are defined publicly
 * @param aLinePrefix  a short string to be displayed in front of each line;
 *                     the advantage of passing this separately instead of
 *                     making it a part of aText is that the logger might
 *                     be able to insert the prefix more efficiently and/or
 *                     (depending on the log format) with extra formatting
 * @param aText        the text to be printed, may consist of multiple lines;
 *                     the log always starts a new line after the text,
regardless
 *                     of how many newlines might be at the end of the text
 */
void SySyncDebugPuts(void* aCB,
                     cAppCharP aFile, int aLine, cAppCharP aFunction,
                     int aDbgLevel, cAppCharP aLinePrefix,
                     cAppCharP aText);

It is tentative because:
1. it has to be called directly instead of via the SDK function
   tables, forcing users to link against libsynthesis
2. it's implementation and the underlying logging facilities in
   libsynthesis are incomplete: file/line/function and prefix
   are discarded

Because of 1, linking in SyncEvolution 1.x dev branch failed when enabling
shared libraries. This patch here solved this. It should be reverted once point
1 gets fixed:
diff --git a/configure-pre.in b/configure-pre.in
index 41f32ac..daf86c8 100644
--- a/configure-pre.in
+++ b/configure-pre.in
@@ -438,8 +438,12 @@ elif test "$enable_shared" = "no"; then
     SYNTHESIS_ENGINE="$SYNTHESIS_LIBS -lsynthesis"
 else
     # link against SDK alone, except in client-test
-    PKG_CHECK_MODULES(SYNTHESIS, "synthesis-sdk")
-    SYNTHESIS_ENGINE="`echo $SYNTHESIS_LIBS | sed -e
's/-lsynthesisstubs/-lsynthesis/'`"
+    #PKG_CHECK_MODULES(SYNTHESIS, "synthesis-sdk")
+    #SYNTHESIS_ENGINE="`echo $SYNTHESIS_LIBS | sed -e
's/-lsynthesisstubs/-lsynthesis/'`"
+
+    # can't use the SDK alone because of sysync::SySyncDebugPuts()
+    PKG_CHECK_MODULES(SYNTHESIS, "synthesis")
+    SYNTHESIS_ENGINE="$SYNTHESIS_LIBS"
 fi

 if test $SYNTHESIS_SRC != "no-synthesis-source"; then
@@ -459,7 +463,11 @@ if test $SYNTHESIS_SRC != "no-synthesis-source"; then
         case $SYNCML_ENGINES in both|client|server)
SYNTHESIS_LIBS="$SYNTHESIS_LIBS $SYNTHESIS_SUBDIR/s
         AC_DEFINE(ENABLE_SYNCML_LINKED, 1, [SyncML engines are linked
directly])
     else
-        SYNTHESIS_LIBS="$SYNTHESIS_LIBS
$SYNTHESIS_SUBDIR/src/libsynthesisstubs.la"
+        # It would be nice if we could avoid linking against libsynthesis.la
here.
+        # This doesn't work at the moment because sysync::SySyncDebugPuts()
+        # is called directly by the libsynthesissdk instead of going through
+        # the normal C function pointer lookup.
+        SYNTHESIS_LIBS="$SYNTHESIS_LIBS $SYNTHESIS_SUBDIR/src/libsynthesis.la"
     fi
     SYNTHESIS_DEP=$SYNTHESIS_LIBS

Point 2 is more involved. We are using the HTML log format. A good
representation of the additional information must be found. Perhaps make it so
that the source information is shown in a box when moving the mouse over a
specific line?

The prefix could be inserted before each line so that it is visible.



--- Bug imported by patrick.ohly@gmx.de 2012-07-29 20:36 UTC  ---

This bug was previously known as _bug_ 715 at https://bugs.meego.com/show_bug.cgi?id=715
Comment 1 GitLab Migration User 2018-10-13 12:45:17 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/SyncEvolution/syncevolution/issues/147.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.