2019-01-29 18:18:42 +03:00
|
|
|
Debugging
|
|
|
|
=========
|
|
|
|
|
2020-09-22 18:46:35 +03:00
|
|
|
For other debugging resources, see also: Remote project [wiki]
|
2019-11-15 16:42:22 +03:00
|
|
|
|
2019-01-29 18:18:42 +03:00
|
|
|
Increasing the logging verbosity
|
|
|
|
--------------------------------
|
|
|
|
|
|
|
|
To increase the internal logging verbosity you can use the
|
|
|
|
`remote.log.level` [preference].
|
|
|
|
|
2019-10-23 18:49:19 +03:00
|
|
|
If you use mach to start Firefox:
|
2019-01-29 18:18:42 +03:00
|
|
|
|
2020-10-07 16:50:57 +03:00
|
|
|
./mach run --setpref "remote.log.level=Trace" --remote-debugging-port
|
2019-01-29 18:18:42 +03:00
|
|
|
|
2020-09-22 18:46:35 +03:00
|
|
|
By default, long log lines are truncated. To print long lines in full, you
|
|
|
|
can set `remote.log.truncate` to false.
|
2019-11-15 16:42:22 +03:00
|
|
|
|
2019-10-23 18:49:19 +03:00
|
|
|
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]:
|
|
|
|
|
2020-10-07 16:50:57 +03:00
|
|
|
./mach run --setpref "toolkit.dump.emit=true" --remote-debuggiing-port
|
2019-10-23 18:49:19 +03:00
|
|
|
|
2019-11-15 16:42:22 +03:00
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
|
2019-08-14 16:42:21 +03:00
|
|
|
[preference]: ./Prefs.html
|
2019-11-15 16:42:22 +03:00
|
|
|
[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
|
2020-09-22 18:46:35 +03:00
|
|
|
[wiki]: https://wiki.mozilla.org/Remote/Developer_Resources
|