diff --git a/src/node_errors.cc b/src/node_errors.cc index e094fe4681fc56..b86ccc3062191a 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 +#endif + namespace node { using errors::TryCatchScope; @@ -426,6 +430,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