Commit 37fe3408 authored by Norby, Tom's avatar Norby, Tom
Browse files

Android logging.

parent b3857c82
Pipeline #139590 failed with stages
in 11 minutes and 28 seconds
TRIBITS_SUBPACKAGE(bug)
IF(ANDROID)
include(${PROJECT_SOURCE_DIR}/sub/qt-android-cmake/AddQtAndroidApk.cmake)
ENDIF()
SET(HEADERS
bug.hh
)
......
......@@ -32,8 +32,12 @@
* radix_tagged_warning(arg) - Same as radixWarning, prefixed with FILE and Line
* radix_block(block) - block - Simply places code block in preprocessor
*/
#ifdef ANDROID
#include <android/log.h>
#endif
#include <cstdio>
#include <iostream>
#if DEBUG_OUTPUT & 1
#ifndef radix_stream
#define radix_stream std::cerr
......@@ -51,8 +55,19 @@
#define radix_flush_warning(arg) \
radix_stream << arg << std::endl; \
fflush(stderr)
#ifdef ANDROID
#define radix_tagged_line(arg) \
radix_stream << __FILE__ << ":" << __LINE__ << ": " << arg << std::endl; \
{ \
std::stringstream r_stream; \
r_stream << __FILE__ << ":" << __LINE__ << ": " << arg << std::endl; \
__android_log_print(ANDROID_LOG_INFO, "C++", "%s", \
r_stream.str().c_str()); \
}
#else
#define radix_tagged_line(arg) \
radix_stream << __FILE__ << ":" << __LINE__ << ": " << arg << std::endl
#endif
#define radix_flush_tagged_line(arg) \
radix_stream << __FILE__ << ":" << __LINE__ << ": " << arg << std::endl; \
fflush(stderr)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment