xref: /aosp_15_r20/external/cronet/net/log/net_log_event_type.cc (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
1 // Copyright 2022 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #include "net/log/net_log_event_type.h"
6 
7 #include "base/notreached.h"
8 
9 namespace net {
10 
NetLogEventTypeToString(NetLogEventType type)11 const char* NetLogEventTypeToString(NetLogEventType type) {
12   switch (type) {
13 #define EVENT_TYPE(label)      \
14   case NetLogEventType::label: \
15     return #label;
16 #include "net/log/net_log_event_type_list.h"
17 #undef EVENT_TYPE
18     default:
19       NOTREACHED();
20       return nullptr;
21   }
22 }
23 
operator <<(std::ostream & os,NetLogEventType type)24 std::ostream& operator<<(std::ostream& os, NetLogEventType type) {
25   return os << NetLogEventTypeToString(type);
26 }
27 
28 }  // namespace net
29