aboutsummaryrefslogtreecommitdiff
path: root/backends/platform/android
diff options
context:
space:
mode:
authorJohannes Schickel2010-11-18 19:12:14 +0000
committerJohannes Schickel2010-11-18 19:12:14 +0000
commite1030e53a537677c234ad39de419fb97b88a37b7 (patch)
treeefa0f61d219a9de5299567c92f80662a7e5fb272 /backends/platform/android
parent411866ee1881d248400da25f1889ad872ed54ee3 (diff)
downloadscummvm-rg350-e1030e53a537677c234ad39de419fb97b88a37b7.tar.gz
scummvm-rg350-e1030e53a537677c234ad39de419fb97b88a37b7.tar.bz2
scummvm-rg350-e1030e53a537677c234ad39de419fb97b88a37b7.zip
BACKENDS: Implement logging API proposed by Max on -devel.
This commits a slightly modified patch from my patch tracker item #3104630 "OSYSTEM: Add logging API as proposed by Max on -devel". I was not able to test compilation on Android and SamsungTV, since there is no toolchain for those on buildbot (or I was too blind to find them). svn-id: r54339
Diffstat (limited to 'backends/platform/android')
-rw-r--r--backends/platform/android/android.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/backends/platform/android/android.cpp b/backends/platform/android/android.cpp
index 38f387b201..7a4ae24e6b 100644
--- a/backends/platform/android/android.cpp
+++ b/backends/platform/android/android.cpp
@@ -299,6 +299,7 @@ public:
virtual void getTimeAndDate(TimeDate &t) const;
virtual Common::TimerManager *getTimerManager();
virtual FilesystemFactory *getFilesystemFactory();
+ virtual void logMessage(LogMessageType::Type type, const char *message);
virtual void addSysArchivesToSearchSet(Common::SearchSet &s, int priority = 0);
};
@@ -1266,6 +1267,23 @@ void OSystem_Android::addSysArchivesToSearchSet(Common::SearchSet &s,
}
}
+void OSystem_Android::logMessage(LogMessageType::Type type, const char *message) {
+ switch (type) {
+ case LogMessageType::kDebug:
+ BaseBackend::logMessage(type, message);
+ break;
+
+ case LogMessageType::kWarning:
+ __android_log_write(ANDROID_LOG_WARN, "ScummVM", message);
+ break;
+
+ case LogMessageType::kError:
+ // FIXME: From the name it looks like this will also quit the program.
+ // This shouldn't do that though.
+ __android_log_assert("Fatal error", "ScummVM", "%s", message);
+ break;
+ }
+}
static jint ScummVM_scummVMMain(JNIEnv* env, jobject self, jobjectArray args) {
OSystem_Android* cpp_obj = OSystem_Android::fromJavaObject(env, self);