| OLD | NEW |
| (Empty) | |
| 1 // Copyright (c) 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef NET_QUIC_PLATFORM_IMPL_QUIC_LOGGING_IMPL_H_ |
| 6 #define NET_QUIC_PLATFORM_IMPL_QUIC_LOGGING_IMPL_H_ |
| 7 |
| 8 #include "base/logging.h" |
| 9 |
| 10 #define QUIC_LOG_IMPL(severity) QUIC_CHROMIUM_LOG_##severity |
| 11 #define QUIC_LOG_EVERY_N_SEC_IMPL(severity, seconds) QUIC_LOG_IMPL(severity) |
| 12 #define QUIC_LOG_FIRST_N_IMPL(severity, n) QUIC_LOG_IMPL(severity) |
| 13 #define QUIC_DLOG_IMPL(severity) QUIC_CHROMIUM_DLOG_##severity |
| 14 #define QUIC_LOG_IF_IMPL(severity, condition) \ |
| 15 QUIC_CHROMIUM_LOG_IF_##severity(condition) |
| 16 |
| 17 #define QUIC_CHROMIUM_LOG_INFO VLOG(1) |
| 18 #define QUIC_CHROMIUM_LOG_WARNING DLOG(WARNING) |
| 19 #define QUIC_CHROMIUM_LOG_ERROR DLOG(ERROR) |
| 20 #define QUIC_CHROMIUM_LOG_FATAL LOG(FATAL) |
| 21 #define QUIC_CHROMIUM_LOG_DFATAL LOG(DFATAL) |
| 22 |
| 23 #define QUIC_CHROMIUM_DLOG_INFO DVLOG(1) |
| 24 #define QUIC_CHROMIUM_DLOG_WARNING DLOG(WARNING) |
| 25 #define QUIC_CHROMIUM_DLOG_ERROR DLOG(ERROR) |
| 26 #define QUIC_CHROMIUM_DLOG_FATAL DLOG(FATAL) |
| 27 #define QUIC_CHROMIUM_DLOG_DFATAL DLOG(DFATAL) |
| 28 |
| 29 #define QUIC_CHROMIUM_LOG_IF_INFO(condition) VLOG_IF(1, condition) |
| 30 #define QUIC_CHROMIUM_LOG_IF_WARNING(condition) DLOG_IF(WARNING, condition) |
| 31 #define QUIC_CHROMIUM_LOG_IF_ERROR(condition) DLOG_IF(ERROR, condition) |
| 32 #define QUIC_CHROMIUM_LOG_IF_FATAL(condition) LOG_IF(FATAL, condition) |
| 33 #define QUIC_CHROMIUM_LOG_IF_DFATAL(condition) LOG_IF(DFATAL, condition) |
| 34 |
| 35 #define QUIC_DVLOG_IMPL(verbose_level) DVLOG(verbose_level) |
| 36 |
| 37 #if defined(OS_WIN) |
| 38 // wingdi.h defines ERROR to be 0. When we call QUIC_DLOG(ERROR), it gets |
| 39 // substituted with 0, and it expands to QUIC_CHROMIUM_DLOG_0. To allow us to |
| 40 // keep using this syntax, we define this macro to do the same thing as |
| 41 // QUIC_CHROMIUM_DLOG_ERROR. |
| 42 #define QUIC_CHROMIUM_LOG_0 QUIC_CHROMIUM_LOG_ERROR |
| 43 #define QUIC_CHROMIUM_DLOG_0 QUIC_CHROMIUM_DLOG_ERROR |
| 44 #define QUIC_CHROMIUM_LOG_IF_0 QUIC_CHROMIUM_LOG_IF_ERROR |
| 45 #endif |
| 46 |
| 47 #endif // NET_QUIC_PLATFORM_IMPL_QUIC_LOGGING_IMPL_H_ |
| OLD | NEW |