Copy //third_party/quic logging library to quiche

This CL also switches code in //third_party/quic/platform to use the
newly-created quiche_logging library. Secondly, this makes some IWYU fixes in third_party/quic/qbone so the presubmit can build.

This is the first in a series of CLs that will transition users of quic_logging to use quiche_logging, and eventually delete quic_logging from //third_party/quic.

gfe-relnote: n/a, no functional change
PiperOrigin-RevId: 288025091
Change-Id: Ib126ca6f19b1c217ebbbaac26b15f06af1cc776d
diff --git a/common/platform/api/quiche_logging.h b/common/platform/api/quiche_logging.h
index 15f5bf3..46c4549 100644
--- a/common/platform/api/quiche_logging.h
+++ b/common/platform/api/quiche_logging.h
@@ -1,6 +1,42 @@
+// Copyright (c) 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
 #ifndef QUICHE_COMMON_PLATFORM_API_QUICHE_LOGGING_H_
 #define QUICHE_COMMON_PLATFORM_API_QUICHE_LOGGING_H_
 
 #include "net/quiche/common/platform/impl/quiche_logging_impl.h"
 
+// Please note following QUICHE_LOG are platform dependent:
+// INFO severity can be degraded (to VLOG(1) or DVLOG(1)).
+// Some platforms may not support QUICHE_LOG_FIRST_N or QUICHE_LOG_EVERY_N_SEC,
+// and they would simply be translated to LOG.
+
+#define QUICHE_DVLOG(verbose_level) QUICHE_DVLOG_IMPL(verbose_level)
+#define QUICHE_DVLOG_IF(verbose_level, condition) \
+  QUICHE_DVLOG_IF_IMPL(verbose_level, condition)
+#define QUICHE_DLOG(severity) QUICHE_DLOG_IMPL(severity)
+#define QUICHE_DLOG_IF(severity, condition) \
+  QUICHE_DLOG_IF_IMPL(severity, condition)
+#define QUICHE_VLOG(verbose_level) QUICHE_VLOG_IMPL(verbose_level)
+#define QUICHE_LOG(severity) QUICHE_LOG_IMPL(severity)
+#define QUICHE_LOG_FIRST_N(severity, n) QUICHE_LOG_FIRST_N_IMPL(severity, n)
+#define QUICHE_LOG_EVERY_N_SEC(severity, seconds) \
+  QUICHE_LOG_EVERY_N_SEC_IMPL(severity, seconds)
+#define QUICHE_LOG_IF(severity, condition) \
+  QUICHE_LOG_IF_IMPL(severity, condition)
+
+#define QUICHE_PREDICT_FALSE(x) QUICHE_PREDICT_FALSE_IMPL(x)
+#define QUICHE_PREDICT_TRUE(x) QUICHE_PREDICT_TRUE_IMPL(x)
+
+// This is a noop in release build.
+#define QUICHE_NOTREACHED() QUICHE_NOTREACHED_IMPL()
+
+#define QUICHE_PLOG(severity) QUICHE_PLOG_IMPL(severity)
+
+#define QUICHE_DLOG_INFO_IS_ON() QUICHE_DLOG_INFO_IS_ON_IMPL()
+#define QUICHE_LOG_INFO_IS_ON() QUICHE_LOG_INFO_IS_ON_IMPL()
+#define QUICHE_LOG_WARNING_IS_ON() QUICHE_LOG_WARNING_IS_ON_IMPL()
+#define QUICHE_LOG_ERROR_IS_ON() QUICHE_LOG_ERROR_IS_ON_IMPL()
+
 #endif  // QUICHE_COMMON_PLATFORM_API_QUICHE_LOGGING_H_
diff --git a/quic/platform/api/quic_clock.cc b/quic/platform/api/quic_clock.cc
index 03851fa..47e84a1 100644
--- a/quic/platform/api/quic_clock.cc
+++ b/quic/platform/api/quic_clock.cc
@@ -6,7 +6,7 @@
 
 #include <limits>
 
-#include "net/third_party/quiche/src/quic/platform/api/quic_logging.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_logging.h"
 
 namespace quic {
 
diff --git a/quic/platform/api/quic_test.h b/quic/platform/api/quic_test.h
index f4ef99a..7dd118d 100644
--- a/quic/platform/api/quic_test.h
+++ b/quic/platform/api/quic_test.h
@@ -5,8 +5,8 @@
 #ifndef QUICHE_QUIC_PLATFORM_API_QUIC_TEST_H_
 #define QUICHE_QUIC_PLATFORM_API_QUIC_TEST_H_
 
-#include "net/third_party/quiche/src/quic/platform/api/quic_logging.h"
 #include "net/quic/platform/impl/quic_test_impl.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_logging.h"
 
 using QuicFlagSaver = QuicFlagSaverImpl;
 
diff --git a/quic/qbone/platform/icmp_packet_test.cc b/quic/qbone/platform/icmp_packet_test.cc
index 30fbe21..b44b7cd 100644
--- a/quic/qbone/platform/icmp_packet_test.cc
+++ b/quic/qbone/platform/icmp_packet_test.cc
@@ -8,6 +8,7 @@
 
 #include <cstdint>
 
+#include "net/third_party/quiche/src/quic/platform/api/quic_logging.h"
 #include "net/third_party/quiche/src/quic/platform/api/quic_test.h"
 #include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
 #include "net/third_party/quiche/src/common/platform/api/quiche_text_utils.h"
diff --git a/quic/qbone/platform/tcp_packet_test.cc b/quic/qbone/platform/tcp_packet_test.cc
index 84645c8..ce1897e 100644
--- a/quic/qbone/platform/tcp_packet_test.cc
+++ b/quic/qbone/platform/tcp_packet_test.cc
@@ -8,6 +8,7 @@
 
 #include <cstdint>
 
+#include "net/third_party/quiche/src/quic/platform/api/quic_logging.h"
 #include "net/third_party/quiche/src/quic/platform/api/quic_test.h"
 #include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
 #include "net/third_party/quiche/src/common/platform/api/quiche_text_utils.h"