| 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 CHROMEOS_NETWORK_NETWORK_EVENT_LOG_H_ | 5 #ifndef CHROMEOS_NETWORK_NETWORK_EVENT_LOG_H_ |
| 6 #define CHROMEOS_NETWORK_NETWORK_EVENT_LOG_H_ | 6 #define CHROMEOS_NETWORK_NETWORK_EVENT_LOG_H_ |
| 7 | 7 |
| 8 #include <deque> | 8 #include <deque> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "base/strings/stringprintf.h" | 12 #include "base/strings/stringprintf.h" |
| 13 #include "base/time/time.h" | 13 #include "base/time/time.h" |
| 14 #include "chromeos/chromeos_export.h" | 14 #include "chromeos/chromeos_export.h" |
| 15 #include "chromeos/device_event_log.h" | 15 #include "components/device_event_log/device_event_log.h" |
| 16 | 16 |
| 17 namespace base { | 17 namespace base { |
| 18 class Value; | 18 class Value; |
| 19 } | 19 } |
| 20 | 20 |
| 21 namespace chromeos { | 21 namespace chromeos { |
| 22 | 22 |
| 23 // Namespace for functions for logging network events. | 23 // Namespace for functions for logging network events. |
| 24 namespace network_event_log { | 24 namespace network_event_log { |
| 25 | 25 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 37 const std::string& event, | 37 const std::string& event, |
| 38 const std::string& description); | 38 const std::string& description); |
| 39 | 39 |
| 40 } // namespace internal | 40 } // namespace internal |
| 41 | 41 |
| 42 // Helper function for displaying a value as a string. | 42 // Helper function for displaying a value as a string. |
| 43 CHROMEOS_EXPORT std::string ValueAsString(const base::Value& value); | 43 CHROMEOS_EXPORT std::string ValueAsString(const base::Value& value); |
| 44 | 44 |
| 45 // Errors | 45 // Errors |
| 46 #define NET_LOG_ERROR(event, desc) \ | 46 #define NET_LOG_ERROR(event, desc) \ |
| 47 NET_LOG_LEVEL(::chromeos::device_event_log::LOG_LEVEL_ERROR, event, desc) | 47 NET_LOG_LEVEL(::device_event_log::LOG_LEVEL_ERROR, event, desc) |
| 48 | 48 |
| 49 // Chrome initiated events, e.g. connection requests, scan requests, | 49 // Chrome initiated events, e.g. connection requests, scan requests, |
| 50 // configuration removal (either from the UI or from ONC policy application). | 50 // configuration removal (either from the UI or from ONC policy application). |
| 51 #define NET_LOG_USER(event, desc) \ | 51 #define NET_LOG_USER(event, desc) \ |
| 52 NET_LOG_LEVEL(::chromeos::device_event_log::LOG_LEVEL_USER, event, desc) | 52 NET_LOG_LEVEL(::device_event_log::LOG_LEVEL_USER, event, desc) |
| 53 | 53 |
| 54 // Important events, e.g. state updates | 54 // Important events, e.g. state updates |
| 55 #define NET_LOG_EVENT(event, desc) \ | 55 #define NET_LOG_EVENT(event, desc) \ |
| 56 NET_LOG_LEVEL(::chromeos::device_event_log::LOG_LEVEL_EVENT, event, desc) | 56 NET_LOG_LEVEL(::device_event_log::LOG_LEVEL_EVENT, event, desc) |
| 57 | 57 |
| 58 // Non-essential debugging events | 58 // Non-essential debugging events |
| 59 #define NET_LOG_DEBUG(event, desc) \ | 59 #define NET_LOG_DEBUG(event, desc) \ |
| 60 NET_LOG_LEVEL(::chromeos::device_event_log::LOG_LEVEL_DEBUG, event, desc) | 60 NET_LOG_LEVEL(::device_event_log::LOG_LEVEL_DEBUG, event, desc) |
| 61 | 61 |
| 62 // Macro to include file and line number info in the event log. | 62 // Macro to include file and line number info in the event log. |
| 63 #define NET_LOG_LEVEL(log_level, event, description) \ | 63 #define NET_LOG_LEVEL(log_level, event, description) \ |
| 64 ::chromeos::device_event_log::AddEntryWithDescription( \ | 64 ::device_event_log::AddEntryWithDescription( \ |
| 65 __FILE__, __LINE__, ::chromeos::device_event_log::LOG_TYPE_NETWORK, \ | 65 __FILE__, __LINE__, ::device_event_log::LOG_TYPE_NETWORK, log_level, \ |
| 66 log_level, event, description) | 66 event, description) |
| 67 | 67 |
| 68 } // namespace network_event_log | 68 } // namespace network_event_log |
| 69 | 69 |
| 70 } // namespace chromeos | 70 } // namespace chromeos |
| 71 | 71 |
| 72 #endif // CHROMEOS_NETWORK_NETWORK_EVENT_LOG_H_ | 72 #endif // CHROMEOS_NETWORK_NETWORK_EVENT_LOG_H_ |
| OLD | NEW |