bug 1596729: remote: document ObserverService logging
authorAndreas Tolfsen <ato@sny.no>
Fri, 15 Nov 2019 13:42:22 +0000
changeset 502168 152910bc090bbef282563755230bec4f2497324a
parent 502167 956e4283483b7be971b2446c6bcaa005dd067d14
child 502169 2412ec5c8ea76986e25a3620774c41f4416381c4
push id114172
push userdluca@mozilla.com
push dateTue, 19 Nov 2019 11:31:10 +0000
treeherdermozilla-inbound@b5c5ba07d3db [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1596729
milestone72.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
bug 1596729: remote: document ObserverService logging DONTBUILD Differential Revision: https://phabricator.services.mozilla.com/D53179
remote/doc/Debugging.md
--- a/remote/doc/Debugging.md
+++ b/remote/doc/Debugging.md
@@ -1,23 +1,49 @@
 Debugging
 =========
 
+
 Increasing the logging verbosity
 --------------------------------
 
 To increase the internal logging verbosity you can use the
 `remote.log.level` [preference].
 
 If you use mach to start Firefox:
 
 	./mach run --setpref "remote.enabled=true" --setpref "remote.log.level=Debug" --remote-debugger
 
+
 Enabling logging of emitted events
 ----------------------------------
 
 To dump events produced by EventEmitter,
 including CDP events produced by the remote agent,
 you can use the `toolkit.dump.emit` [preference]:
 
     ./mach run --setpref "remote.enabled=true" --setpref "toolkit.dump.emit=true" --remote-debugger
 
+
+Logging observer notifications
+------------------------------
+
+[System observer notifications] are used extensively throughout the
+code and it can sometimes be useful to log these to see what is
+available and when they are fired.
+
+The `MOZ_LOG` environment variable controls the C++ logs and takes
+the name of the subsystem along with a verbosity setting.  See
+[prlog.h] for more details.
+
+	MOZ_LOG=ObserverService:5
+
+You can optionally redirect logs away from stdout to a file:
+
+	MOZ_LOG_FILE=service.log
+
+This enables `LogLevel::Debug` level information and places all
+output in the file service.log in your current working directory.
+
+
 [preference]: ./Prefs.html
+[System observer notifications]: https://developer.mozilla.org/en-US/docs/Archive/Add-ons/Overlay_Extensions/XUL_School/Observer_Notifications
+[prlog.h]: https://searchfox.org/mozilla-central/source/nsprpub/pr/include/prlog.h