diff options
author | Giovanni Campagna <gcampagn@cs.stanford.edu> | 2017-09-25 02:13:45 +0300 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2019-12-12 17:10:13 +0300 |
commit | 73df09e66bb54764817de3f87154bdbc8e391a23 (patch) | |
tree | d430ffefdae1d0b627117bd40aa9857146f1580f /src/node_errors.cc | |
parent | 99fe9dd11225daf238c72978198237dcdc0b22bc (diff) |
build: on Android, use android log library to print stack traces
And other errors like lost promises
PR-URL: https://github.com/nodejs/node/pull/29388
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Christian Clauss <cclauss@me.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Diffstat (limited to 'src/node_errors.cc')
-rw-r--r-- | src/node_errors.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/node_errors.cc b/src/node_errors.cc index 17c1bd7f55c..9474fbb1131 100644 --- a/src/node_errors.cc +++ b/src/node_errors.cc @@ -10,6 +10,10 @@ #include "node_v8_platform-inl.h" #include "util-inl.h" +#ifdef __ANDROID__ +#include <android/log.h> +#endif + namespace node { using errors::TryCatchScope; @@ -429,6 +433,8 @@ void PrintErrorString(const char* format, ...) { // Don't include the null character in the output CHECK_GT(n, 0); WriteConsoleW(stderr_handle, wbuf.data(), n - 1, nullptr, nullptr); +#elif defined(__ANDROID__) + __android_log_vprint(ANDROID_LOG_ERROR, "nodejs", format, ap); #else vfprintf(stderr, format, ap); #endif |