| OLD | NEW |
| 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 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 440 // for each platform. | 440 // for each platform. |
| 441 #define PLOG_STREAM(severity) LOG_ERRNO_STREAM(severity) | 441 #define PLOG_STREAM(severity) LOG_ERRNO_STREAM(severity) |
| 442 #endif | 442 #endif |
| 443 | 443 |
| 444 #define PLOG(severity) \ | 444 #define PLOG(severity) \ |
| 445 LAZY_STREAM(PLOG_STREAM(severity), LOG_IS_ON(severity)) | 445 LAZY_STREAM(PLOG_STREAM(severity), LOG_IS_ON(severity)) |
| 446 | 446 |
| 447 #define PLOG_IF(severity, condition) \ | 447 #define PLOG_IF(severity, condition) \ |
| 448 LAZY_STREAM(PLOG_STREAM(severity), LOG_IS_ON(severity) && (condition)) | 448 LAZY_STREAM(PLOG_STREAM(severity), LOG_IS_ON(severity) && (condition)) |
| 449 | 449 |
| 450 #if !defined(LOGGING_IS_OFFICIAL_BUILD) |
| 450 #if defined(OFFICIAL_BUILD) && defined(NDEBUG) | 451 #if defined(OFFICIAL_BUILD) && defined(NDEBUG) |
| 451 #define LOGGING_IS_OFFICIAL_BUILD 1 | 452 #define LOGGING_IS_OFFICIAL_BUILD 1 |
| 452 #else | 453 #else |
| 453 #define LOGGING_IS_OFFICIAL_BUILD 0 | 454 #define LOGGING_IS_OFFICIAL_BUILD 0 |
| 454 #endif | 455 #endif |
| 456 #endif |
| 455 | 457 |
| 456 // The actual stream used isn't important. | 458 // The actual stream used isn't important. |
| 457 #define EAT_STREAM_PARAMETERS \ | 459 #define EAT_STREAM_PARAMETERS \ |
| 458 true ? (void) 0 : ::logging::LogMessageVoidify() & LOG_STREAM(FATAL) | 460 true ? (void) 0 : ::logging::LogMessageVoidify() & LOG_STREAM(FATAL) |
| 459 | 461 |
| 460 // CHECK dies with a fatal error if condition is not true. It is *not* | 462 // CHECK dies with a fatal error if condition is not true. It is *not* |
| 461 // controlled by NDEBUG, so the check will be executed regardless of | 463 // controlled by NDEBUG, so the check will be executed regardless of |
| 462 // compilation mode. | 464 // compilation mode. |
| 463 // | 465 // |
| 464 // We make sure CHECK et al. always evaluates their arguments, as | 466 // We make sure CHECK et al. always evaluates their arguments, as |
| (...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 983 #elif NOTIMPLEMENTED_POLICY == 5 | 985 #elif NOTIMPLEMENTED_POLICY == 5 |
| 984 #define NOTIMPLEMENTED() do {\ | 986 #define NOTIMPLEMENTED() do {\ |
| 985 static bool logged_once = false;\ | 987 static bool logged_once = false;\ |
| 986 LOG_IF(ERROR, !logged_once) << NOTIMPLEMENTED_MSG;\ | 988 LOG_IF(ERROR, !logged_once) << NOTIMPLEMENTED_MSG;\ |
| 987 logged_once = true;\ | 989 logged_once = true;\ |
| 988 } while(0);\ | 990 } while(0);\ |
| 989 EAT_STREAM_PARAMETERS | 991 EAT_STREAM_PARAMETERS |
| 990 #endif | 992 #endif |
| 991 | 993 |
| 992 #endif // BASE_LOGGING_H_ | 994 #endif // BASE_LOGGING_H_ |
| OLD | NEW |