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

Side by Side Diff: base/logging.h

Issue 2386613003: Test to compile out VLOG
Patch Set: Created 4 years, 2 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 | « no previous file | 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 #ifndef BASE_LOGGING_H_ 5 #ifndef BASE_LOGGING_H_
6 #define BASE_LOGGING_H_ 6 #define BASE_LOGGING_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <cassert> 10 #include <cassert>
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 #define LOG_STREAM(severity) COMPACT_GOOGLE_LOG_ ## severity.stream() 374 #define LOG_STREAM(severity) COMPACT_GOOGLE_LOG_ ## severity.stream()
375 375
376 #define LOG(severity) LAZY_STREAM(LOG_STREAM(severity), LOG_IS_ON(severity)) 376 #define LOG(severity) LAZY_STREAM(LOG_STREAM(severity), LOG_IS_ON(severity))
377 #define LOG_IF(severity, condition) \ 377 #define LOG_IF(severity, condition) \
378 LAZY_STREAM(LOG_STREAM(severity), LOG_IS_ON(severity) && (condition)) 378 LAZY_STREAM(LOG_STREAM(severity), LOG_IS_ON(severity) && (condition))
379 379
380 // The VLOG macros log with negative verbosities. 380 // The VLOG macros log with negative verbosities.
381 #define VLOG_STREAM(verbose_level) \ 381 #define VLOG_STREAM(verbose_level) \
382 ::logging::LogMessage(__FILE__, __LINE__, -verbose_level).stream() 382 ::logging::LogMessage(__FILE__, __LINE__, -verbose_level).stream()
383 383
384 #define VLOG(verbose_level) \ 384 #define VLOG(verbose_level) EAT_STREAM_PARAMETERS
385 LAZY_STREAM(VLOG_STREAM(verbose_level), VLOG_IS_ON(verbose_level))
386 385
387 #define VLOG_IF(verbose_level, condition) \ 386 #define VLOG_IF(verbose_level, condition) EAT_STREAM_PARAMETERS
388 LAZY_STREAM(VLOG_STREAM(verbose_level), \
389 VLOG_IS_ON(verbose_level) && (condition))
390 387
391 #if defined (OS_WIN) 388 #if defined (OS_WIN)
392 #define VPLOG_STREAM(verbose_level) \ 389 #define VPLOG_STREAM(verbose_level) \
393 ::logging::Win32ErrorLogMessage(__FILE__, __LINE__, -verbose_level, \ 390 ::logging::Win32ErrorLogMessage(__FILE__, __LINE__, -verbose_level, \
394 ::logging::GetLastSystemErrorCode()).stream() 391 ::logging::GetLastSystemErrorCode()).stream()
395 #elif defined(OS_POSIX) 392 #elif defined(OS_POSIX)
396 #define VPLOG_STREAM(verbose_level) \ 393 #define VPLOG_STREAM(verbose_level) \
397 ::logging::ErrnoLogMessage(__FILE__, __LINE__, -verbose_level, \ 394 ::logging::ErrnoLogMessage(__FILE__, __LINE__, -verbose_level, \
398 ::logging::GetLastSystemErrorCode()).stream() 395 ::logging::GetLastSystemErrorCode()).stream()
399 #endif 396 #endif
(...skipping 588 matching lines...) Expand 10 before | Expand all | Expand 10 after
988 #elif NOTIMPLEMENTED_POLICY == 5 985 #elif NOTIMPLEMENTED_POLICY == 5
989 #define NOTIMPLEMENTED() do {\ 986 #define NOTIMPLEMENTED() do {\
990 static bool logged_once = false;\ 987 static bool logged_once = false;\
991 LOG_IF(ERROR, !logged_once) << NOTIMPLEMENTED_MSG;\ 988 LOG_IF(ERROR, !logged_once) << NOTIMPLEMENTED_MSG;\
992 logged_once = true;\ 989 logged_once = true;\
993 } while(0);\ 990 } while(0);\
994 EAT_STREAM_PARAMETERS 991 EAT_STREAM_PARAMETERS
995 #endif 992 #endif
996 993
997 #endif // BASE_LOGGING_H_ 994 #endif // BASE_LOGGING_H_
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698