summaryrefslogtreecommitdiffstats
path: root/gpu/command_buffer
diff options
context:
space:
mode:
authorjamesr@chromium.org <jamesr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-12 23:28:57 +0000
committerjamesr@chromium.org <jamesr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-12 23:28:57 +0000
commitdca1a3fe589085e65f1298cde3a48921989ef70d (patch)
tree9970d30afc76c8ff53a2b857fd146c08b150d22a /gpu/command_buffer
parent40279e83cd92b0a6479fe77b6356dfe87a76a3b2 (diff)
downloadchromium_src-dca1a3fe589085e65f1298cde3a48921989ef70d.zip
chromium_src-dca1a3fe589085e65f1298cde3a48921989ef70d.tar.gz
chromium_src-dca1a3fe589085e65f1298cde3a48921989ef70d.tar.bz2
Revert 59119 - Removed includion of <iostream> from logging.h.
So that it does not introduce static initializers into including files. TEST=try BUG=54904 Review URL: http://codereview.chromium.org/3354018 Reverting due to serious perf regression in some cases. TBR=apatrick@chromium.org Review URL: http://codereview.chromium.org/3358030 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@59203 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu/command_buffer')
-rw-r--r--gpu/command_buffer/common/logging.h18
1 files changed, 7 insertions, 11 deletions
diff --git a/gpu/command_buffer/common/logging.h b/gpu/command_buffer/common/logging.h
index b183683..191f711a 100644
--- a/gpu/command_buffer/common/logging.h
+++ b/gpu/command_buffer/common/logging.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2009 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.
@@ -6,10 +6,8 @@
#define GPU_COMMAND_BUFFER_COMMON_LOGGING_H_
#include <assert.h>
-#include <stdio.h>
-#include <sstream>
-#include <string>
+#include <iostream>
// Windows defines an ERROR macro.
#ifdef ERROR
@@ -28,8 +26,8 @@ enum LogLevel {
};
// This is a very simple logger for use in command buffer code. Common and
-// client side command buffer code cannot be dependent on base. It just outputs
-// the message to stderr, flushes and asserts if the error was fatal.
+// command buffer code cannot be dependent on base. It just outputs the message
+// to stderr.
class Logger {
public:
Logger(bool condition, LogLevel level)
@@ -115,9 +113,8 @@ class Logger {
~Logger() {
if (!condition_) {
- message_stream_ << std::endl;
- fputs(message_stream_.str().c_str(), stderr);
- fflush(stderr);
+ std::cerr << std::endl;
+ std::cerr.flush();
if (level_ == FATAL)
assert(false);
}
@@ -126,7 +123,7 @@ class Logger {
template <typename T>
Logger& operator<<(const T& value) {
if (!condition_)
- message_stream_ << value;
+ std::cerr << value;
return *this;
}
@@ -134,7 +131,6 @@ class Logger {
Logger(const Logger& logger): condition_(logger.condition_) {
}
- std::stringstream message_stream_;
bool condition_;
LogLevel level_;
};