1Debugging
2=========
3
4For other debugging resources, see also: Remote project [wiki]
5
6Increasing the logging verbosity
7--------------------------------
8
9To increase the internal logging verbosity you can use the
10`remote.log.level` [preference].
11
12If you use mach to start Firefox:
13
14	./mach run --setpref "remote.log.level=Trace" --remote-debugging-port
15
16By default, long log lines are truncated. To print long lines in full, you
17can set `remote.log.truncate` to false.
18
19Enabling logging of emitted events
20----------------------------------
21
22To dump events produced by EventEmitter,
23including CDP events produced by the Remote Agent,
24you can use the `toolkit.dump.emit` [preference]:
25
26  ./mach run --setpref "toolkit.dump.emit=true" --remote-debuggiing-port
27
28
29Logging observer notifications
30------------------------------
31
32[System observer notifications] are used extensively throughout the
33code and it can sometimes be useful to log these to see what is
34available and when they are fired.
35
36The `MOZ_LOG` environment variable controls the C++ logs and takes
37the name of the subsystem along with a verbosity setting.  See
38[prlog.h] for more details.
39
40	MOZ_LOG=ObserverService:5
41
42You can optionally redirect logs away from stdout to a file:
43
44	MOZ_LOG_FILE=service.log
45
46This enables `LogLevel::Debug` level information and places all
47output in the file service.log in your current working directory.
48
49
50[preference]: ./Prefs.html
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
54