aboutsummaryrefslogtreecommitdiff
path: root/src/client/linux/log/log.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/linux/log/log.h')
-rw-r--r--src/client/linux/log/log.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/client/linux/log/log.h b/src/client/linux/log/log.h
index a50e30dc..f94bbd5f 100644
--- a/src/client/linux/log/log.h
+++ b/src/client/linux/log/log.h
@@ -36,6 +36,20 @@ namespace logger {
int write(const char* buf, size_t nbytes);
+// In the case of Android the log can be written to the default system log
+// (default behavior of write() above, or to the crash log (see
+// writeToCrashLog() below).
+#if defined(__ANDROID__)
+
+// The logger must be initialized in a non-compromised context.
+void initializeCrashLogWriter();
+
+// Once initialized, writeToCrashLog is safe to use in a compromised context,
+// even if the initialization failed, in which case this will silently fall
+// back on write().
+int writeToCrashLog(const char* buf);
+#endif
+
} // namespace logger
#endif // CLIENT_LINUX_LOG_LOG_H_