Skip to content

Commit ebe6a55

Browse files
gcampaxBethGriggs
authored andcommitted
build: on Android, use android log library to print stack traces
And other errors like lost promises PR-URL: #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>
1 parent fbf5bee commit ebe6a55

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/node_errors.cc

+6
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
#include "node_v8_platform-inl.h"
1111
#include "util-inl.h"
1212

13+
#ifdef __ANDROID__
14+
#include <android/log.h>
15+
#endif
16+
1317
namespace node {
1418

1519
using errors::TryCatchScope;
@@ -426,6 +430,8 @@ void PrintErrorString(const char* format, ...) {
426430
// Don't include the null character in the output
427431
CHECK_GT(n, 0);
428432
WriteConsoleW(stderr_handle, wbuf.data(), n - 1, nullptr, nullptr);
433+
#elif defined(__ANDROID__)
434+
__android_log_vprint(ANDROID_LOG_ERROR, "nodejs", format, ap);
429435
#else
430436
vfprintf(stderr, format, ap);
431437
#endif

0 commit comments

Comments
 (0)