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 595 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
606 #define DLOG(severity) \ | 606 #define DLOG(severity) \ |
607 LAZY_STREAM(LOG_STREAM(severity), DLOG_IS_ON(severity)) | 607 LAZY_STREAM(LOG_STREAM(severity), DLOG_IS_ON(severity)) |
608 | 608 |
609 #define DPLOG(severity) \ | 609 #define DPLOG(severity) \ |
610 LAZY_STREAM(PLOG_STREAM(severity), DLOG_IS_ON(severity)) | 610 LAZY_STREAM(PLOG_STREAM(severity), DLOG_IS_ON(severity)) |
611 | 611 |
612 #define DVLOG(verboselevel) DVLOG_IF(verboselevel, VLOG_IS_ON(verboselevel)) | 612 #define DVLOG(verboselevel) DVLOG_IF(verboselevel, VLOG_IS_ON(verboselevel)) |
613 | 613 |
614 #define DVPLOG(verboselevel) DVPLOG_IF(verboselevel, VLOG_IS_ON(verboselevel)) | 614 #define DVPLOG(verboselevel) DVPLOG_IF(verboselevel, VLOG_IS_ON(verboselevel)) |
615 | 615 |
616 // TODO(vitalybuka): following should be removed and replaced with PLOG. | |
617 #if defined(OS_WIN) | |
618 #define LOG_GETLASTERROR(severity) PLOG(severity) | |
619 #define DLOG_GETLASTERROR(severity) DPLOG(severity) | |
620 #elif defined(OS_POSIX) | |
621 #define LOG_ERRNO(severity) PLOG(severity) | |
622 #define DLOG_ERRNO(severity) DPLOG(severity) | |
623 #endif | |
624 | |
625 // Definitions for DCHECK et al. | 616 // Definitions for DCHECK et al. |
626 | 617 |
627 #if DCHECK_IS_ON | 618 #if DCHECK_IS_ON |
628 | 619 |
629 #define COMPACT_GOOGLE_LOG_EX_DCHECK(ClassName, ...) \ | 620 #define COMPACT_GOOGLE_LOG_EX_DCHECK(ClassName, ...) \ |
630 COMPACT_GOOGLE_LOG_EX_FATAL(ClassName , ##__VA_ARGS__) | 621 COMPACT_GOOGLE_LOG_EX_FATAL(ClassName , ##__VA_ARGS__) |
631 #define COMPACT_GOOGLE_LOG_DCHECK COMPACT_GOOGLE_LOG_FATAL | 622 #define COMPACT_GOOGLE_LOG_DCHECK COMPACT_GOOGLE_LOG_FATAL |
632 const LogSeverity LOG_DCHECK = LOG_FATAL; | 623 const LogSeverity LOG_DCHECK = LOG_FATAL; |
633 | 624 |
634 #else // DCHECK_IS_ON | 625 #else // DCHECK_IS_ON |
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
926 #elif NOTIMPLEMENTED_POLICY == 5 | 917 #elif NOTIMPLEMENTED_POLICY == 5 |
927 #define NOTIMPLEMENTED() do {\ | 918 #define NOTIMPLEMENTED() do {\ |
928 static bool logged_once = false;\ | 919 static bool logged_once = false;\ |
929 LOG_IF(ERROR, !logged_once) << NOTIMPLEMENTED_MSG;\ | 920 LOG_IF(ERROR, !logged_once) << NOTIMPLEMENTED_MSG;\ |
930 logged_once = true;\ | 921 logged_once = true;\ |
931 } while(0);\ | 922 } while(0);\ |
932 EAT_STREAM_PARAMETERS | 923 EAT_STREAM_PARAMETERS |
933 #endif | 924 #endif |
934 | 925 |
935 #endif // BASE_LOGGING_H_ | 926 #endif // BASE_LOGGING_H_ |
OLD | NEW |