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

Side by Side Diff: base/logging.cc

Issue 2559323007: Improve EAT_STREAM_PARAMETERS for Windows x86 (Closed)
Patch Set: back to ps7, extern ostream* Created 4 years 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
« no previous file with comments | « base/logging.h ('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
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/logging.h" 5 #include "base/logging.h"
6 6
7 #include <limits.h> 7 #include <limits.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include "base/debug/activity_tracker.h" 10 #include "base/debug/activity_tracker.h"
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after
336 void CloseLogFileUnlocked() { 336 void CloseLogFileUnlocked() {
337 if (!g_log_file) 337 if (!g_log_file)
338 return; 338 return;
339 339
340 CloseFile(g_log_file); 340 CloseFile(g_log_file);
341 g_log_file = nullptr; 341 g_log_file = nullptr;
342 } 342 }
343 343
344 } // namespace 344 } // namespace
345 345
346 // This is never instantiated, it's just used for EAT_STREAM_PARAMETERS to have
347 // an object of the correct type on the LHS of the unused part of the ternary
348 // operator.
349 std::ostream* g_swallow_stream;
350
346 LoggingSettings::LoggingSettings() 351 LoggingSettings::LoggingSettings()
347 : logging_dest(LOG_DEFAULT), 352 : logging_dest(LOG_DEFAULT),
348 log_file(nullptr), 353 log_file(nullptr),
349 lock_log(LOCK_LOG_FILE), 354 lock_log(LOCK_LOG_FILE),
350 delete_old(APPEND_TO_OLD_LOG_FILE) {} 355 delete_old(APPEND_TO_OLD_LOG_FILE) {}
351 356
352 bool BaseInitLoggingImpl(const LoggingSettings& settings) { 357 bool BaseInitLoggingImpl(const LoggingSettings& settings) {
353 #if defined(OS_NACL) 358 #if defined(OS_NACL)
354 // Can log only to the system debug log. 359 // Can log only to the system debug log.
355 CHECK_EQ(settings.logging_dest & ~LOG_TO_SYSTEM_DEBUG_LOG, 0); 360 CHECK_EQ(settings.logging_dest & ~LOG_TO_SYSTEM_DEBUG_LOG, 0);
(...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after
943 BASE_EXPORT void LogErrorNotReached(const char* file, int line) { 948 BASE_EXPORT void LogErrorNotReached(const char* file, int line) {
944 LogMessage(file, line, LOG_ERROR).stream() 949 LogMessage(file, line, LOG_ERROR).stream()
945 << "NOTREACHED() hit."; 950 << "NOTREACHED() hit.";
946 } 951 }
947 952
948 } // namespace logging 953 } // namespace logging
949 954
950 std::ostream& std::operator<<(std::ostream& out, const wchar_t* wstr) { 955 std::ostream& std::operator<<(std::ostream& out, const wchar_t* wstr) {
951 return out << (wstr ? base::WideToUTF8(wstr) : std::string()); 956 return out << (wstr ? base::WideToUTF8(wstr) : std::string());
952 } 957 }
OLDNEW
« no previous file with comments | « base/logging.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698