Components.utils.reportError() is easy to use for debugging
Firefox 3.0+ supports Components.utils.reportError()
. This function send a debugging message to the Error Console.
Components.utils.reportError("a debugging message");
yields following message to the Error Console:
If you don't hope debugging message displayed as a error, nsIConsoleService#logStringMessage() is better.
yields following message to the Error Console:
This way is too long to write!
Use of dump()
is shortest, but you need to run firefox with terminal (command prompt).
Conclusion
reportError() | logStringMessage() | dump() | |
---|---|---|---|
Output | Error Console as a error message | Error Console as a plain message | Terminal (Command prompt) |
Length of code | Not long | Long | Very short |