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

Side by Side Diff: base/logging.h

Issue 2731823002: Replace use of logging::DEBUG_MODE with DCHECK_IS_ON(). (Closed)
Patch Set: Created 3 years, 9 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 | base/logging_unittest.cc » ('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 <stddef.h> 8 #include <stddef.h>
9 9
10 #include <cassert> 10 #include <cassert>
(...skipping 729 matching lines...) Expand 10 before | Expand all | Expand 10 after
740 740
741 #define DLOG_IS_ON(severity) false 741 #define DLOG_IS_ON(severity) false
742 #define DLOG_IF(severity, condition) EAT_STREAM_PARAMETERS 742 #define DLOG_IF(severity, condition) EAT_STREAM_PARAMETERS
743 #define DLOG_ASSERT(condition) EAT_STREAM_PARAMETERS 743 #define DLOG_ASSERT(condition) EAT_STREAM_PARAMETERS
744 #define DPLOG_IF(severity, condition) EAT_STREAM_PARAMETERS 744 #define DPLOG_IF(severity, condition) EAT_STREAM_PARAMETERS
745 #define DVLOG_IF(verboselevel, condition) EAT_STREAM_PARAMETERS 745 #define DVLOG_IF(verboselevel, condition) EAT_STREAM_PARAMETERS
746 #define DVPLOG_IF(verboselevel, condition) EAT_STREAM_PARAMETERS 746 #define DVPLOG_IF(verboselevel, condition) EAT_STREAM_PARAMETERS
747 747
748 #endif // DCHECK_IS_ON() 748 #endif // DCHECK_IS_ON()
749 749
750 // DEBUG_MODE is for runtime uses like
751 // if (DEBUG_MODE) foo.CheckThatFoo();
752 // We tie its state to DCHECK_IS_ON().
753 //
754 // For compile-time checks, #if DCHECK_IS_ON() can be used.
755 enum { DEBUG_MODE = DCHECK_IS_ON() };
756
757 #define DLOG(severity) \ 750 #define DLOG(severity) \
758 LAZY_STREAM(LOG_STREAM(severity), DLOG_IS_ON(severity)) 751 LAZY_STREAM(LOG_STREAM(severity), DLOG_IS_ON(severity))
759 752
760 #define DPLOG(severity) \ 753 #define DPLOG(severity) \
761 LAZY_STREAM(PLOG_STREAM(severity), DLOG_IS_ON(severity)) 754 LAZY_STREAM(PLOG_STREAM(severity), DLOG_IS_ON(severity))
762 755
763 #define DVLOG(verboselevel) DVLOG_IF(verboselevel, VLOG_IS_ON(verboselevel)) 756 #define DVLOG(verboselevel) DVLOG_IF(verboselevel, VLOG_IS_ON(verboselevel))
764 757
765 #define DVPLOG(verboselevel) DVPLOG_IF(verboselevel, VLOG_IS_ON(verboselevel)) 758 #define DVPLOG(verboselevel) DVPLOG_IF(verboselevel, VLOG_IS_ON(verboselevel))
766 759
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after
1146 #elif NOTIMPLEMENTED_POLICY == 5 1139 #elif NOTIMPLEMENTED_POLICY == 5
1147 #define NOTIMPLEMENTED() do {\ 1140 #define NOTIMPLEMENTED() do {\
1148 static bool logged_once = false;\ 1141 static bool logged_once = false;\
1149 LOG_IF(ERROR, !logged_once) << NOTIMPLEMENTED_MSG;\ 1142 LOG_IF(ERROR, !logged_once) << NOTIMPLEMENTED_MSG;\
1150 logged_once = true;\ 1143 logged_once = true;\
1151 } while(0);\ 1144 } while(0);\
1152 EAT_STREAM_PARAMETERS 1145 EAT_STREAM_PARAMETERS
1153 #endif 1146 #endif
1154 1147
1155 #endif // BASE_LOGGING_H_ 1148 #endif // BASE_LOGGING_H_
OLDNEW
« no previous file with comments | « no previous file | base/logging_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698