On 06/07/2012 01:31 PM, Lukas Zeller wrote:
Hi Andris,

thanks for the patch. However, the SMLERRPRINTFX() macro, like all debug output 
macros across the entire library, is supposed to output a linefeed by itself. 
It also actually does so in my builds of libsynthesis, so if the LFs are 
missing in your output, it must be something along the path from 
SMLERRPRINTFX() to the actual output function.

I think the problem is in the CONSOLEINFO_LIBC shortcut output mode Patrick 
added this February (13ff1e4149 (logging + Linux: enable console output)), 
where CONSOLEPRINTF() is mapped to fprintf(stderr,...) without adding a LF. In 
my (iOS) build this new mode is not used, but output ends in a plain puts(), 
which does add the LF.

So my suggestion would be this:

diff --git a/src/sysync/sysync_debug.h b/src/sysync/sysync_debug.h
index 61d4cdd..68dce5e 100755
--- a/src/sysync/sysync_debug.h
+++ b/src/sysync/sysync_debug.h
@@ -110,7 +110,7 @@ TDebugLogger *getDbgLogger(void);
    // Because a lot of libs log to stderr, include a unique prefix.
    // Assumes that all printf format strings are plain strings.
    #define CONSOLEPUTS(m) CONSOLE_PRINTF_VARARGS("%s", (m))
-#define CONSOLE_PRINTF_VARARGS(_m, _args...) fprintf(stderr, "SYSYNC " _m, 
##_args)
+#define CONSOLE_PRINTF_VARARGS(_m, _args...) fprintf(stderr, "SYSYNC " _m 
"\n", ##_args)
    #define CONSOLEPRINTF(m) CONSOLE_PRINTF_VARARGS m
  # else // CONSOLEINFO_LIBC
    #define CONSOLEPUTS(m) ConsolePuts(m)

Can you please check if this solves the problem in your build?
If You verify my recent e-mails, you'll find exactly the same suggestion ("\n" added as above).

CONSOLE_PRINTF_VARARGS (and other similar macros) can however be used to output a message in parts (not only entire message in one piece) in that case extra "\n" are not needed. The same about the string "SYSYNC " which should only be present only at the begin of the message but any more in the middle. That was a reason why I dropped earlier suggestion which was identical with Yours and suggested other way.

Andris


_______________________________________________
os-libsynthesis mailing list
[email protected]
http://lists.synthesis.ch/mailman/listinfo/os-libsynthesis

Reply via email to