Commit 2200e6d4 authored by skyostil@chromium.org's avatar skyostil@chromium.org

gpu: Implement debug logging on Android

This patch adds an Android backend for gpu::Logging. The debug log
output is written to logcat with the log tag "chromium-gpu".

BUG=232449

Review URL: https://chromiumcodereview.appspot.com/17471007

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@208059 0039d316-1c4b-4281-b951-d872f2087c98
parent ad6aa8f9
......@@ -21,6 +21,16 @@
'common/logging.cc',
'common/logging.h',
],
'conditions': [
['OS=="android"', {
'sources!': [
'common/logging.cc',
],
'sources': [
'common/logging_android.cc',
],
}],
],
}],
],
},
......
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <android/log.h>
#include <iostream>
#include <sstream>
#include "gpu/command_buffer/common/logging.h"
namespace gpu {
namespace {
std::stringstream* g_log;
const char* kLogTag = "chromium-gpu";
}
std::ostream& Logger::stream() {
if (!g_log)
g_log = new std::stringstream();
return *g_log;
}
Logger::~Logger() {
if (!condition_) {
__android_log_print(ANDROID_LOG_INFO, kLogTag, "%s", g_log->str().c_str());
g_log->str(std::string());
if (level_ == FATAL)
assert(false);
}
}
} // namespace gpu
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