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

Side by Side Diff: base/logging.h

Issue 2351423002: Fix DCHECK usage doc comment. (Closed)
Patch Set: Created 4 years, 3 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 713 matching lines...) Expand 10 before | Expand all | Expand 10 after
724 else \ 724 else \
725 ::logging::LogMessage(__FILE__, __LINE__, ::logging::LOG_DCHECK, \ 725 ::logging::LogMessage(__FILE__, __LINE__, ::logging::LOG_DCHECK, \
726 true_if_passed.message()).stream() 726 true_if_passed.message()).stream()
727 727
728 // Equality/Inequality checks - compare two values, and log a 728 // Equality/Inequality checks - compare two values, and log a
729 // LOG_DCHECK message including the two values when the result is not 729 // LOG_DCHECK message including the two values when the result is not
730 // as expected. The values must have operator<<(ostream, ...) 730 // as expected. The values must have operator<<(ostream, ...)
731 // defined. 731 // defined.
732 // 732 //
733 // You may append to the error message like so: 733 // You may append to the error message like so:
734 // DCHECK_NE(1, 2) << ": The world must be ending!"; 734 // DCHECK_NE(1, 2) << "The world must be ending!";
735 // 735 //
736 // We are very careful to ensure that each argument is evaluated exactly 736 // We are very careful to ensure that each argument is evaluated exactly
737 // once, and that anything which is legal to pass as a function argument is 737 // once, and that anything which is legal to pass as a function argument is
738 // legal here. In particular, the arguments may be temporary expressions 738 // legal here. In particular, the arguments may be temporary expressions
739 // which will end up being destroyed at the end of the apparent statement, 739 // which will end up being destroyed at the end of the apparent statement,
740 // for example: 740 // for example:
741 // DCHECK_EQ(string("abc")[1], 'b'); 741 // DCHECK_EQ(string("abc")[1], 'b');
742 // 742 //
743 // WARNING: These don't compile correctly if one of the arguments is a pointer 743 // WARNING: These don't compile correctly if one of the arguments is a pointer
744 // and the other is NULL. In new code, prefer nullptr instead. To 744 // and the other is NULL. In new code, prefer nullptr instead. To
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
988 #elif NOTIMPLEMENTED_POLICY == 5 988 #elif NOTIMPLEMENTED_POLICY == 5
989 #define NOTIMPLEMENTED() do {\ 989 #define NOTIMPLEMENTED() do {\
990 static bool logged_once = false;\ 990 static bool logged_once = false;\
991 LOG_IF(ERROR, !logged_once) << NOTIMPLEMENTED_MSG;\ 991 LOG_IF(ERROR, !logged_once) << NOTIMPLEMENTED_MSG;\
992 logged_once = true;\ 992 logged_once = true;\
993 } while(0);\ 993 } while(0);\
994 EAT_STREAM_PARAMETERS 994 EAT_STREAM_PARAMETERS
995 #endif 995 #endif
996 996
997 #endif // BASE_LOGGING_H_ 997 #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