cc: Added inline to Tile::IsReadyToDraw
[chromium-blink-merge.git] / gpu / command_buffer / common / logging_android.cc
blobd660080d4c7251abd8b231e1252e3b0c012f2bec
1 // Copyright 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.
5 #include <android/log.h>
6 #include <iostream>
7 #include <sstream>
9 #include "gpu/command_buffer/common/logging.h"
11 namespace gpu {
13 namespace {
14 std::stringstream* g_log;
15 const char* kLogTag = "chromium-gpu";
18 std::ostream& Logger::stream() {
19 if (!g_log)
20 g_log = new std::stringstream();
21 return *g_log;
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);
33 } // namespace gpu