Closed Bug 818317 Opened 13 years ago Closed 12 years ago

Expose debug messages in navigator.mozPay() for debug enabled profiles

Categories

(Core :: DOM: Device Interfaces, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla26

People

(Reporter: kumar, Assigned: ferjm)

References

Details

Attachments

(1 file)

In navigator.mozPay(), the only way to currently get debug output is to build a custom B2G with the dump statement uncommented, per http://mxr.mozilla.org/mozilla-central/source/dom/payment/Payment.jsm#29 Can we change this so that the dump() output is shown for debug profiles? I don't know the typical way this is done but I've seen other parts of the system show dump messages from debug-enabled profiles that were built like this: cd ~/src/gaia export DEBUG=1 make profile /path/to/nightly/b2g-bin -profile ... If we can get this change then we could use the nightly builds of B2G and still have an opportunity to see errors.
If I am not wrong, the DEBUG flag is only useful on Gaia side. Would adding a preference to enable mozPay debug output at run-time work for you?
sure, a dom pref to enable mozPay debug would be fine too. The issue is that we'd like to use nightly builds for development, not custom builds. Whatever is easiest.
Assignee: nobody → ferjmoreno
Something like how you can turn on identity debug messages would be helpful http://mxr.mozilla.org/mozilla-central/source/dom/identity/nsDOMIdentity.js#9 However, there are lots of workarounds and the DOMRequest error codes are already very helpful too. I.E. Not an urgent request :)
Blocks: basecamp-payments
No longer blocks: marketplace-payments
No longer blocks: basecamp-payments
Attached patch v1Splinter Review
This patch adds a "dom.payment.debug" preference to enable payment debug messages.
Attachment #782630 - Flags: review?(fabrice)
Comment on attachment 782630 [details] [diff] [review] v1 Review of attachment 782630 [details] [diff] [review]: ----------------------------------------------------------------- r=me with nits addressed and propagated to other files. ::: b2g/chrome/content/payment.js @@ +15,5 @@ > > +const PREF_DEBUG = "dom.payment.debug"; > +let _debug = > + Services.prefs.getPrefType(PREF_DEBUG) == Ci.nsIPrefBranch.PREF_BOOL > + && Services.prefs.getBoolPref(PREF_DEBUG); does getPrefType throw if the pref does not exist at all? @@ +17,5 @@ > +let _debug = > + Services.prefs.getPrefType(PREF_DEBUG) == Ci.nsIPrefBranch.PREF_BOOL > + && Services.prefs.getBoolPref(PREF_DEBUG); > + > +function _log(s) { s/_log/LOG @@ +27,5 @@ > + > +if (_debug) { > + _log("Frame script injected"); > +} > + LOG(...) is enough...
Comment on attachment 782630 [details] [diff] [review] v1 Review of attachment 782630 [details] [diff] [review]: ----------------------------------------------------------------- r=me with nits addressed and propagated to other files. ::: b2g/chrome/content/payment.js @@ +15,5 @@ > > +const PREF_DEBUG = "dom.payment.debug"; > +let _debug = > + Services.prefs.getPrefType(PREF_DEBUG) == Ci.nsIPrefBranch.PREF_BOOL > + && Services.prefs.getBoolPref(PREF_DEBUG); does getPrefType throw if the pref does not exist at all? @@ +17,5 @@ > +let _debug = > + Services.prefs.getPrefType(PREF_DEBUG) == Ci.nsIPrefBranch.PREF_BOOL > + && Services.prefs.getBoolPref(PREF_DEBUG); > + > +function _log(s) { s/_log/LOG @@ +27,5 @@ > + > +if (_debug) { > + _log("Frame script injected"); > +} > + LOG(...) is enough...
Attachment #782630 - Flags: review?(fabrice) → review+
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla26
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: