Set up Android-specific debugging
Change-Id: I293568f0d0ee42dd64ee869e3c3ba28810e4883a
Reviewed-on: https://swiftshader-review.googlesource.com/2824
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Greg Hartman <ghartman@google.com>
diff --git a/src/Common/Debug.cpp b/src/Common/Debug.cpp
index b06e98f..a122c42 100644
--- a/src/Common/Debug.cpp
+++ b/src/Common/Debug.cpp
@@ -11,38 +11,23 @@
#include "Debug.hpp"
-#ifdef __ANDROID__
-#include <utils/String8.h>
-#include <cutils/log.h>
-#endif
-
#include <stdio.h>
#include <stdarg.h>
-#ifdef __ANDROID__
- void trace(const char *format, ...)
+void trace(const char *format, ...)
+{
+ if(false)
{
- va_list vararg;
- va_start(vararg, format);
- ALOGI("%s", android::String8::formatV(format, vararg).string());
- va_end(vararg);
- }
-#else
- void trace(const char *format, ...)
- {
- if(false)
+ FILE *file = fopen("debug.txt", "a");
+
+ if(file)
{
- FILE *file = fopen("debug.txt", "a");
+ va_list vararg;
+ va_start(vararg, format);
+ vfprintf(file, format, vararg);
+ va_end(vararg);
- if(file)
- {
- va_list vararg;
- va_start(vararg, format);
- vfprintf(file, format, vararg);
- va_end(vararg);
-
- fclose(file);
- }
+ fclose(file);
}
}
-#endif
+}