Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(667)

Unified Diff: components/device_event_log/README.md

Issue 2799353002: Restore BLUETOOTH_LOG and convert bluetooth_adapter_bluez to use it (Closed)
Patch Set: Fix BUILD.gn Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/webui/device_log_ui.cc ('k') | components/device_event_log/device_event_log.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/device_event_log/README.md
diff --git a/components/device_event_log/README.md b/components/device_event_log/README.md
new file mode 100644
index 0000000000000000000000000000000000000000..f899ee80f7d39ee39feacb482ee194311ff23807
--- /dev/null
+++ b/components/device_event_log/README.md
@@ -0,0 +1,49 @@
+# Device Event Log
+
+This directory contains code for logging device and system events.
+
+## Usage
+
+Use device event log macros to record events without contributing to noise in
+the chrome log.
+
+* Events are stored in a circular buffer (current limit is 4000).
+* Events can be viewed at chrome://device-log. Events can be filtered by type
+ and level.
+* Events show up in **feedback reports** under `device_event_log`.
+* Network events are separated out into a `network_event_log` section.
+* **ERROR** events will also be logged to the main chrome log.
+* All events can be logged to the main chrome log using vlog:
+ `--vmodule=device_event_log*=1`
+
+The events can also be queried for viewing in other informational pages, e.g:
+```
+device_event_log::GetAsString(device_event_log::OLDEST_FIRST, "json",
+ "bluetooth", device_event_log::LOG_LEVEL_DEBUG,
+ 1000);
+```
+
+## Examples
+
+Typical usage:
+
+```NET_LOG(EVENT) << "NetworkState Changed " << name << ": " << state;```
+
+```POWER_LOG(USER) << "Suspend requested";```
+
+```POWER_LOG(DEBUG) << "Sending suspend request to dbus object: " << path;```
+
+```BLUETOOTH_LOG(ERROR) << "Unrecognized DBus error " << error_name;```
+
+Advanced usage:
+
+```
+device_event_log::LogLevel log_level =
+ SuppressError(dbus_error_message) ? device_event_log::LOG_LEVEL_DEBUG
+ : device_event_log::LOG_LEVEL_ERROR;
+DEVICE_LOG(device_event_log::LOG_TYPE_NETWORK, log_level) << detail;
+```
+
+```
+USB_PLOG(DEBUG) << "Failed to set configuration " << configuration_value;
+```
« no previous file with comments | « chrome/browser/ui/webui/device_log_ui.cc ('k') | components/device_event_log/device_event_log.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698