http://bugzilla.moblin.org/show_bug.cgi?id=8264
Summary: improved logging via libsynthesis
Classification: Moblin Projects
Product: SyncEvolution
Version: upstream
Platform: Netbook
OS/Version: Moblin Linux
Status: ASSIGNED
Severity: normal
Priority: P2
Component: *Feature Request
AssignedTo: syncevolution(a)lists.intel.com
ReportedBy: patrick.ohly(a)intel.com
CC: syncevolution(a)lists.intel.com
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.
--
Configure bugmail:
http://bugzilla.moblin.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching the assignee of the bug.
You are watching someone on the CC list of the bug.