diff mbox

[Branch,~glmark2-dev/glmark2/trunk] Rev 165: Log: Skip the log continuation character when displaying info messages in normal mode.

Message ID 20111111111212.23901.14411.launchpad@ackee.canonical.com
State Accepted
Headers show

Commit Message

alexandros.frantzis@linaro.org Nov. 11, 2011, 11:12 a.m. UTC
------------------------------------------------------------
revno: 165
committer: Alexandros Frantzis <alexandros.frantzis@linaro.org>
branch nick: trunk
timestamp: Fri 2011-11-11 12:36:48 +0200
message:
  Log: Skip the log continuation character when displaying info messages in normal mode.
modified:
  src/log.cpp


--
lp:glmark2
https://code.launchpad.net/~glmark2-dev/glmark2/trunk

You are subscribed to branch lp:glmark2.
To unsubscribe from this branch go to https://code.launchpad.net/~glmark2-dev/glmark2/trunk/+edit-subscription
diff mbox

Patch

=== modified file 'src/log.cpp'
--- src/log.cpp	2011-11-10 10:33:26 +0000
+++ src/log.cpp	2011-11-11 10:36:48 +0000
@@ -92,6 +92,20 @@ 
     delete[] buf;
 }
 
+static void
+print_plain_message(FILE *stream, const char *fmt, va_list ap)
+{
+    va_list aq;
+    const char *msg = fmt;
+
+    if (msg[0] == LOG_CONTINUE[0])
+        msg++;
+
+    va_copy(aq, ap);
+    vfprintf(stream, msg, ap);
+    va_end(aq);
+}
+
 void
 Log::info(const char *fmt, ...)
 {
@@ -100,7 +114,7 @@ 
     if (Options::show_debug)
         print_prefixed_message(stdout, terminal_color_cyan, "Info", fmt, ap);
     else
-        vfprintf(stdout, fmt, ap);
+        print_plain_message(stdout, fmt, ap);
     va_end(ap);
 }