Skip to content

Commit d90815d

Browse files
gcampaxMylesBorins
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 <[email protected]> Reviewed-By: Christian Clauss <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Rich Trott <[email protected]>
1 parent d1c4fcc commit d90815d

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;
@@ -429,6 +433,8 @@ void PrintErrorString(const char* format, ...) {
429433
// Don't include the null character in the output
430434
CHECK_GT(n, 0);
431435
WriteConsoleW(stderr_handle, wbuf.data(), n - 1, nullptr, nullptr);
436+
#elif defined(__ANDROID__)
437+
__android_log_vprint(ANDROID_LOG_ERROR, "nodejs", format, ap);
432438
#else
433439
vfprintf(stderr, format, ap);
434440
#endif

0 commit comments

Comments
 (0)