summaryrefslogtreecommitdiff
path: root/src/logger.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-10-15 01:19:22 +0300
committerAndrei Karas <akaras@inbox.ru>2012-10-15 01:19:22 +0300
commit6621d3bc9efc488b60148dd45e3aa6cb291059a7 (patch)
tree35516f60bdb8a568793b8e726bd88931cef3307e /src/logger.cpp
parent28461343d1bfd030f2cc74d3353930e09a13db37 (diff)
downloadmv-6621d3bc9efc488b60148dd45e3aa6cb291059a7.tar.gz
mv-6621d3bc9efc488b60148dd45e3aa6cb291059a7.tar.bz2
mv-6621d3bc9efc488b60148dd45e3aa6cb291059a7.tar.xz
mv-6621d3bc9efc488b60148dd45e3aa6cb291059a7.zip
Extend Android logger.
Diffstat (limited to 'src/logger.cpp')
-rw-r--r--src/logger.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/logger.cpp b/src/logger.cpp
index ba7c7be50..f125bf9eb 100644
--- a/src/logger.cpp
+++ b/src/logger.cpp
@@ -39,11 +39,14 @@
#include <sys/time.h>
-#ifdef __ANDROID__
+#if defined(__ANDROID__) && defined(ANDROID_LOG)
#include <android/log.h>
-#define LOG_AND(x) __android_log_print(ANDROID_LOG_INFO, "manaplus", x)
+#define LOG_ANDROID(x) __android_log_print(ANDROID_LOG_INFO, "manaplus", x);
+#define DLOG_ANDROID(x) __android_log_print(ANDROID_LOG_VERBOSE, \
+ "manaplus", x);
#else
-#define LOG_AND(x)
+#define LOG_ANDROID(x)
+#define DLOG_ANDROID(x)
#endif
#include "debug.h"
@@ -105,6 +108,8 @@ void Logger::dlog(std::string str)
<< static_cast<int>((tv.tv_usec / 10000) % 100)
<< "] ";
+ DLOG_ANDROID(str)
+
if (mLogFile.is_open())
mLogFile << timeStr.str() << str << std::endl;
@@ -137,6 +142,8 @@ void Logger::log1(const char *const buf)
<< static_cast<int>((tv.tv_usec / 10000) % 100)
<< "] ";
+ LOG_ANDROID(buf)
+
if (mLogFile.is_open())
mLogFile << timeStr.str() << buf << std::endl;
@@ -182,6 +189,8 @@ void Logger::log(const char *const log_text, ...)
<< static_cast<int>((tv.tv_usec / 10000) % 100)
<< "] ";
+ LOG_ANDROID(buf)
+
if (mLogFile.is_open())
mLogFile << timeStr.str() << buf << std::endl;