Commit 6807f826 by Yuly Novikov Committed by Commit Bot

Print more logs when using default Platform

Some logs prior to Test Platform initialization were getting lost. 1. Also print WARN() to stdout 2. Use Android specific logging facilities BUG=angleproject:1660 Change-Id: I8424958426809567396ef24cedc2d427a3a21959 Reviewed-on: https://chromium-review.googlesource.com/887944Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
parent 881b7bfa
......@@ -16,6 +16,10 @@
#include <ostream>
#include <vector>
#if defined(ANGLE_PLATFORM_ANDROID)
#include <android/log.h>
#endif
#include "common/angleutils.h"
#include "common/Optional.h"
......@@ -160,10 +164,16 @@ void Trace(LogSeverity severity, const char *message)
}
}
if (severity == LOG_ERR)
if (severity == LOG_ERR || severity == LOG_WARN)
{
#if defined(ANGLE_PLATFORM_ANDROID)
__android_log_print((severity == LOG_ERR) ? ANDROID_LOG_ERROR : ANDROID_LOG_WARN, "ANGLE",
"%s: %s\n", LogSeverityName(severity), str.c_str());
#else
// Note: we use fprintf because <iostream> includes static initializers.
fprintf(stderr, "%s: %s\n", LogSeverityName(severity), str.c_str());
fprintf((severity == LOG_ERR) ? stderr : stdout, "%s: %s\n", LogSeverityName(severity),
str.c_str());
#endif
}
#if defined(ANGLE_PLATFORM_WINDOWS) && \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment