• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

BUILD.gnH A D07-Nov-2020672 3327

OWNERSH A D07-Nov-202074 43

README.mdH A D07-Nov-20201.6 KiB5035

device_event_log.ccH A D07-Nov-20204.1 KiB136105

device_event_log.hH A D07-Nov-202010.1 KiB257144

device_event_log_export.hH A D07-Nov-2020958 3520

device_event_log_impl.ccH A D07-Nov-202017.1 KiB507441

device_event_log_impl.hH A D07-Nov-20203.4 KiB10977

device_event_log_impl_unittest.ccH A D07-Nov-202012.9 KiB368290

README.md

1# Device Event Log
2
3This directory contains code for logging device and system events.
4
5## Usage
6
7Use device event log macros to record events without contributing to noise in
8the chrome log.
9
10* Events are stored in a circular buffer (current limit is 4000).
11* Events can be viewed at chrome://device-log. Events can be filtered by type
12  and level.
13* Events show up in **feedback reports** under `device_event_log`.
14* Network events are separated out into a `network_event_log` section.
15* **ERROR** events will also be logged to the main chrome log.
16* All events can be logged to the main chrome log using vlog:
17  `--vmodule=device_event_log*=1`
18
19The events can also be queried for viewing in other informational pages, e.g:
20```
21device_event_log::GetAsString(device_event_log::OLDEST_FIRST, "json",
22                              "bluetooth", device_event_log::LOG_LEVEL_DEBUG,
23                              1000);
24```
25
26## Examples
27
28Typical usage:
29
30```NET_LOG(EVENT) << "NetworkState Changed " << name << ": " << state;```
31
32```POWER_LOG(USER) << "Suspend requested";```
33
34```POWER_LOG(DEBUG) << "Sending suspend request to dbus object: " << path;```
35
36```BLUETOOTH_LOG(ERROR) << "Unrecognized DBus error " << error_name;```
37
38Advanced usage:
39
40```
41device_event_log::LogLevel log_level =
42      SuppressError(dbus_error_message) ? device_event_log::LOG_LEVEL_DEBUG
43                                        : device_event_log::LOG_LEVEL_ERROR;
44DEVICE_LOG(device_event_log::LOG_TYPE_NETWORK, log_level) << detail;
45```
46
47```
48USB_PLOG(DEBUG) << "Failed to set configuration " << configuration_value;
49```
50