Skip to content

Commit f18b9da

Browse files
committed
build: on Android, use android log library to print stack traces
And other errors like lost promises
1 parent 77c2273 commit f18b9da

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/node_errors.cc

Lines changed: 6 additions & 0 deletions
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;
@@ -413,6 +417,8 @@ void PrintErrorString(const char* format, ...) {
413417
// Don't include the null character in the output
414418
CHECK_GT(n, 0);
415419
WriteConsoleW(stderr_handle, wbuf.data(), n - 1, nullptr, nullptr);
420+
#elif defined(__ANDROID__)
421+
__android_log_vprint(ANDROID_LOG_ERROR, "nodejs", format, ap);
416422
#else
417423
vfprintf(stderr, format, ap);
418424
#endif

0 commit comments

Comments
 (0)