Skip to content

Commit c385e2d

Browse files
committed
Switch back to __android_log_vprint
1 parent 402bf9e commit c385e2d

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

external/logging/logging.cc

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,7 @@ void Logger::logv(LogLevel level, const char *_fmt, va_list ap) {
104104

105105
if (1 || !enable_syslog_ && log_file_ == nullptr) {
106106
#if defined(__ANDROID__)
107-
// __android_log_vprint(ANDROID_LOG_INFO, NULL, fmt_buffer, ap);
108-
char out[4096] = {0};
109-
vsnprintf(out, sizeof(out) - 1, fmt_buffer, ap);
110-
__android_log_print(ANDROID_LOG_INFO, NULL, "%s", out);
107+
__android_log_vprint(ANDROID_LOG_INFO, NULL, fmt_buffer, ap);
111108
#else
112109
vprintf(fmt_buffer, ap);
113110
#endif

source/Backend/UserMode/UnifiedInterface/platform-posix.cc

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -176,10 +176,7 @@ void OSPrint::Print(const char *format, ...) {
176176

177177
void OSPrint::VPrint(const char *format, va_list args) {
178178
#if defined(ANDROID) && !defined(ANDROID_LOG_STDOUT)
179-
// __android_log_vprint(ANDROID_LOG_INFO, ANDROID_LOG_TAG, format, args);
180-
char out[4096] = {0};
181-
vsnprintf(out, sizeof(out) - 1, format, args);
182-
__android_log_print(ANDROID_LOG_INFO, NULL, "%s", out);
179+
__android_log_vprint(ANDROID_LOG_INFO, ANDROID_LOG_TAG, format, args);
183180
#else
184181
vprintf(format, args);
185182
#endif

0 commit comments

Comments
 (0)