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

Side by Side Diff: base/logging.h

Issue 935333002: Update from https://crrev.com/316786 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 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
« no previous file with comments | « base/ios/crb_protocol_observers_unittest.mm ('k') | base/mac/sdk_forward_declarations.h » ('j') | 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 #ifndef BASE_LOGGING_H_ 5 #ifndef BASE_LOGGING_H_
6 #define BASE_LOGGING_H_ 6 #define BASE_LOGGING_H_
7 7
8 #include <cassert> 8 #include <cassert>
9 #include <string> 9 #include <string>
10 #include <cstring> 10 #include <cstring>
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after
343 ((::logging::LOG_ ## severity) >= ::logging::GetMinLogLevel()) 343 ((::logging::LOG_ ## severity) >= ::logging::GetMinLogLevel())
344 344
345 // We can't do any caching tricks with VLOG_IS_ON() like the 345 // We can't do any caching tricks with VLOG_IS_ON() like the
346 // google-glog version since it requires GCC extensions. This means 346 // google-glog version since it requires GCC extensions. This means
347 // that using the v-logging functions in conjunction with --vmodule 347 // that using the v-logging functions in conjunction with --vmodule
348 // may be slow. 348 // may be slow.
349 #define VLOG_IS_ON(verboselevel) \ 349 #define VLOG_IS_ON(verboselevel) \
350 ((verboselevel) <= ::logging::GetVlogLevel(__FILE__)) 350 ((verboselevel) <= ::logging::GetVlogLevel(__FILE__))
351 351
352 // Helper macro which avoids evaluating the arguments to a stream if 352 // Helper macro which avoids evaluating the arguments to a stream if
353 // the condition doesn't hold. 353 // the condition doesn't hold. Condition is evaluated once and only once.
354 #define LAZY_STREAM(stream, condition) \ 354 #define LAZY_STREAM(stream, condition) \
355 !(condition) ? (void) 0 : ::logging::LogMessageVoidify() & (stream) 355 !(condition) ? (void) 0 : ::logging::LogMessageVoidify() & (stream)
356 356
357 // We use the preprocessor's merging operator, "##", so that, e.g., 357 // We use the preprocessor's merging operator, "##", so that, e.g.,
358 // LOG(INFO) becomes the token COMPACT_GOOGLE_LOG_INFO. There's some funny 358 // LOG(INFO) becomes the token COMPACT_GOOGLE_LOG_INFO. There's some funny
359 // subtle difference between ostream member streaming functions (e.g., 359 // subtle difference between ostream member streaming functions (e.g.,
360 // ostream::operator<<(int) and ostream non-member streaming functions 360 // ostream::operator<<(int) and ostream non-member streaming functions
361 // (e.g., ::operator<<(ostream&, string&): it turns out that it's 361 // (e.g., ::operator<<(ostream&, string&): it turns out that it's
362 // impossible to stream something like a string directly to an unnamed 362 // impossible to stream something like a string directly to an unnamed
363 // ostream. We employ a neat hack by calling the stream() member 363 // ostream. We employ a neat hack by calling the stream() member
(...skipping 562 matching lines...) Expand 10 before | Expand all | Expand 10 after
926 #elif NOTIMPLEMENTED_POLICY == 5 926 #elif NOTIMPLEMENTED_POLICY == 5
927 #define NOTIMPLEMENTED() do {\ 927 #define NOTIMPLEMENTED() do {\
928 static bool logged_once = false;\ 928 static bool logged_once = false;\
929 LOG_IF(ERROR, !logged_once) << NOTIMPLEMENTED_MSG;\ 929 LOG_IF(ERROR, !logged_once) << NOTIMPLEMENTED_MSG;\
930 logged_once = true;\ 930 logged_once = true;\
931 } while(0);\ 931 } while(0);\
932 EAT_STREAM_PARAMETERS 932 EAT_STREAM_PARAMETERS
933 #endif 933 #endif
934 934
935 #endif // BASE_LOGGING_H_ 935 #endif // BASE_LOGGING_H_
OLDNEW
« no previous file with comments | « base/ios/crb_protocol_observers_unittest.mm ('k') | base/mac/sdk_forward_declarations.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698