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

Side by Side Diff: base/logging.h

Issue 336413005: [Android] Spill out CHECK error message in official build (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: update commit message Created 6 years, 6 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 | Annotate | Revision Log
« 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 <cassert> 8 #include <cassert>
9 #include <string> 9 #include <string>
10 #include <cstring> 10 #include <cstring>
(...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after
426 #define EAT_STREAM_PARAMETERS \ 426 #define EAT_STREAM_PARAMETERS \
427 true ? (void) 0 : ::logging::LogMessageVoidify() & LOG_STREAM(FATAL) 427 true ? (void) 0 : ::logging::LogMessageVoidify() & LOG_STREAM(FATAL)
428 428
429 // CHECK dies with a fatal error if condition is not true. It is *not* 429 // CHECK dies with a fatal error if condition is not true. It is *not*
430 // controlled by NDEBUG, so the check will be executed regardless of 430 // controlled by NDEBUG, so the check will be executed regardless of
431 // compilation mode. 431 // compilation mode.
432 // 432 //
433 // We make sure CHECK et al. always evaluates their arguments, as 433 // We make sure CHECK et al. always evaluates their arguments, as
434 // doing CHECK(FunctionWithSideEffect()) is a common idiom. 434 // doing CHECK(FunctionWithSideEffect()) is a common idiom.
435 435
436 #if defined(OFFICIAL_BUILD) && defined(NDEBUG) 436 #if defined(OFFICIAL_BUILD) && defined(NDEBUG) && !defined(OS_ANDROID)
437 437
438 // Make all CHECK functions discard their log strings to reduce code 438 // Make all CHECK functions discard their log strings to reduce code
439 // bloat for official release builds. 439 // bloat for official release builds.
440 440
441 // TODO(akalin): This would be more valuable if there were some way to 441 // TODO(akalin): This would be more valuable if there were some way to
442 // remove BreakDebugger() from the backtrace, perhaps by turning it 442 // remove BreakDebugger() from the backtrace, perhaps by turning it
443 // into a macro (like __debugbreak() on Windows). 443 // into a macro (like __debugbreak() on Windows).
444 #define CHECK(condition) \ 444 #define CHECK(condition) \
445 !(condition) ? ::base::debug::BreakDebugger() : EAT_STREAM_PARAMETERS 445 !(condition) ? ::base::debug::BreakDebugger() : EAT_STREAM_PARAMETERS
446 446
(...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after
880 #elif NOTIMPLEMENTED_POLICY == 5 880 #elif NOTIMPLEMENTED_POLICY == 5
881 #define NOTIMPLEMENTED() do {\ 881 #define NOTIMPLEMENTED() do {\
882 static bool logged_once = false;\ 882 static bool logged_once = false;\
883 LOG_IF(ERROR, !logged_once) << NOTIMPLEMENTED_MSG;\ 883 LOG_IF(ERROR, !logged_once) << NOTIMPLEMENTED_MSG;\
884 logged_once = true;\ 884 logged_once = true;\
885 } while(0);\ 885 } while(0);\
886 EAT_STREAM_PARAMETERS 886 EAT_STREAM_PARAMETERS
887 #endif 887 #endif
888 888
889 #endif // BASE_LOGGING_H_ 889 #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