Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(587)

Unified Diff: gpu/command_buffer/common/logging_android.cc

Issue 17471007: gpu: Implement debug logging on Android (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove dependency on base::LazyInstance. Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gpu/command_buffer/command_buffer.gypi ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/common/logging_android.cc
diff --git a/gpu/command_buffer/common/logging_android.cc b/gpu/command_buffer/common/logging_android.cc
new file mode 100644
index 0000000000000000000000000000000000000000..fd95ae2d5e33e7e9b0953b294336894e82a532c0
--- /dev/null
+++ b/gpu/command_buffer/common/logging_android.cc
@@ -0,0 +1,33 @@
+// Copyright (c) 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
« no previous file with comments | « gpu/command_buffer/command_buffer.gypi ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698