Skip to content

Commit add17b1

Browse files
gcampaxtargos
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 65e67cb commit add17b1

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)