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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « gpu/command_buffer/command_buffer.gypi ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include <android/log.h>
6 #include <iostream>
7 #include <sstream>
8
9 #include "gpu/command_buffer/common/logging.h"
10
11 namespace gpu {
12
13 namespace {
14 std::stringstream* g_log;
15 const char* kLogTag = "chromium-gpu";
16 }
17
18 std::ostream& Logger::stream() {
19 if (!g_log)
20 g_log = new std::stringstream();
21 return *g_log;
22 }
23
24 Logger::~Logger() {
25 if (!condition_) {
26 __android_log_print(ANDROID_LOG_INFO, kLogTag, "%s", g_log->str().c_str());
27 g_log->str(std::string());
28 if (level_ == FATAL)
29 assert(false);
30 }
31 }
32
33 } // namespace gpu
OLDNEW
« 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