From 4a20449a89bc0a2382ab075c4efb380080ee8a02 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Wed, 30 Oct 2019 23:36:44 +0100 Subject: [PATCH 1/1] Override log_err/log_warn in connection since stdout/stderr don't work This will provide errors to logcat in case of early startup issues. For more info: https://trac.torproject.org/projects/tor/ticket/32036 --- src/core/mainloop/connection.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/core/mainloop/connection.c b/src/core/mainloop/connection.c index 6094f33e4..228aeef3a 100644 --- a/src/core/mainloop/connection.c +++ b/src/core/mainloop/connection.c @@ -129,6 +129,13 @@ #include #endif +/* Override log_err and log_warn here since stdout/stderr don't work #32026 */ +#ifdef __ANDROID__ +#include +#define log_err(ignored, ...) __android_log_print(ANDROID_LOG_ERROR, "Tor-connection", ##__VA_ARGS__) +#define log_warn(ignored, ...) __android_log_print(ANDROID_LOG_WARN, "Tor-connection", ##__VA_ARGS__) +#endif // __ANDROID__ + #include "feature/dircommon/dir_connection_st.h" #include "feature/control/control_connection_st.h" #include "core/or/entry_connection_st.h" -- 2.20.1