]> git.cworth.org Git - apitrace/blobdiff - os_posix.cpp
Eliminate more string comparisons.
[apitrace] / os_posix.cpp
index 3f423fe99cd1e01d3f8b7312e6590fbe37981f52..f4dbaab5c3119f572923ce5a7496f2bfbb0fc36a 100644 (file)
@@ -30,7 +30,7 @@
 #include <pthread.h>
 
 #include "os.hpp"
-#include "log.hpp"
+#include "trace_write.hpp"
 
 namespace OS {
 
@@ -88,10 +88,13 @@ GetCurrentDir(char *str, size_t size)
 }
 
 void
-DebugMessage(const char *message)
+DebugMessage(const char *format, ...)
 {
+   va_list ap;
+   va_start(ap, format);
    fflush(stdout);
-   fputs(message, stderr);
+   vfprintf(stderr, format, ap);
+   va_end(ap);
 }
 
 void
@@ -105,6 +108,6 @@ Abort(void)
 
 static void _uninit(void) __attribute__((destructor));
 static void _uninit(void) {
-    Log::Close();
+    Trace::Close();
 }