Bug 1792034 [wpt PR 36019] - Make location.search always expect UTF-8, a=testonly
[gecko.git] / remote / doc / Debugging.md
blob86df75022d3070bc95a8377cc76d3f7fb88dd198
1 Debugging
2 =========
4 For other debugging resources, see also: Remote project [wiki]
6 Increasing the logging verbosity
7 --------------------------------
9 To increase the internal logging verbosity you can use the
10 `remote.log.level` [preference].
12 If you use mach to start Firefox:
14         ./mach run --setpref "remote.log.level=Trace" --remote-debugging-port
16 By default, long log lines are truncated. To print long lines in full, you
17 can set `remote.log.truncate` to false.
19 Enabling logging of emitted events
20 ----------------------------------
22 To dump events produced by EventEmitter,
23 including CDP events produced by the Remote Agent,
24 you can use the `toolkit.dump.emit` [preference]:
26   ./mach run --setpref "toolkit.dump.emit=true" --remote-debugging-port
29 Logging observer notifications
30 ------------------------------
32 Observer notifications are used extensively throughout the
33 code and it can sometimes be useful to log these to see what is
34 available and when they are fired.
36 The `MOZ_LOG` environment variable controls the C++ logs and takes
37 the name of the subsystem along with a verbosity setting.  See
38 [prlog.h] for more details.
40         MOZ_LOG=ObserverService:5
42 You can optionally redirect logs away from stdout to a file:
44         MOZ_LOG_FILE=service.log
46 This enables `LogLevel::Debug` level information and places all
47 output in the file service.log in your current working directory.
50 [preference]: Prefs.md
51 [System observer notifications]: https://developer.mozilla.org/en-US/docs/Archive/Add-ons/Overlay_Extensions/XUL_School/Observer_Notifications
52 [prlog.h]: https://searchfox.org/mozilla-central/source/nsprpub/pr/include/prlog.h
53 [wiki]: https://wiki.mozilla.org/Remote/Developer_Resources