Hash :
f5bb220f
Author :
Date :
2017-02-17T23:25:17
Restore Default Platform logging to stderr Was lost in https://chromium-review.googlesource.com/434188 Also, don't reset pre-set Platform to Default, otherwise Chrome's platform gets reset. BUG=angleproject:1660, angleproject:1892 Change-Id: I052c86c513c8d89d2420a4724a8bd0dc7446c7c2 Reviewed-on: https://chromium-review.googlesource.com/444928 Commit-Queue: Yuly Novikov <ynovikov@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
//
// Copyright 2017 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// LoggingAnnotator.cpp: DebugAnnotator implementing logging
//
#include "libANGLE/LoggingAnnotator.h"
#include <platform/Platform.h>
namespace angle
{
void LoggingAnnotator::logMessage(const gl::LogMessage &msg) const
{
auto *plat = ANGLEPlatformCurrent();
if (plat != nullptr)
{
switch (msg.getSeverity())
{
case gl::LOG_ERR:
plat->logError(plat, msg.getMessage().c_str());
break;
case gl::LOG_WARN:
plat->logWarning(plat, msg.getMessage().c_str());
break;
default:
UNREACHABLE();
}
}
else
{
gl::Trace(msg.getSeverity(), msg.getMessage().c_str());
}
}
} // namespace angle