Closed Bug 1071793 Opened 10 years ago Closed 10 years ago

Improve debug output for Settings API

Categories

(Core :: DOM: Device Interfaces, defect)

25 Branch
x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 1106896
Tracking Status
b2g-v1.4 --- unaffected
b2g-v2.0 --- unaffected
b2g-v2.0M --- unaffected
b2g-v2.1 --- affected
b2g-v2.2 --- affected

People

(Reporter: qdot, Assigned: qdot)

References

Details

(Whiteboard: [systemsfe])

Attachments

(1 file, 1 obsolete file)

We need more/better ways to output debug information for the settings API. - Switch debug messages to being pref'd on/off instead of requiring compiled in change - Add memory reporters to SettingsManager/SettingsRequestManager/SettingsService
I know :bent isn't a fan of debug functions that always run while possibly having arguments that require resolution, but I really need a way to be able to tell QA and reporters to turn on debug messages without having to kick out a new build.
Attachment #8494268 - Flags: review?(bent.mozilla)
Comment on attachment 8494268 [details] [diff] [review] Patch 1 (v1) - Add pref to turn on/off settings debug messages Review of attachment 8494268 [details] [diff] [review]: ----------------------------------------------------------------- Your other option is to do something like: let DEBUG = Services.prefs.getBoolPref("dom.mozSettings.debug"); function debug() { dump("-*- SettingsManager : " + aMsg + "\n") } and to replace all your calls to debug(...) by DEBUG && debug(...)
Ok yeah maybe I shouldn't code while as tired as I am right now. 'cause that was nice and obvious. Implemented Fabrice's suggestion and lopped like 40k off the patch.
Attachment #8494268 - Attachment is obsolete: true
Attachment #8494268 - Flags: review?(bent.mozilla)
Attachment #8494279 - Flags: review?(bent.mozilla)
Comment on attachment 8494279 [details] [diff] [review] Patch 1 (v2) - Add pref to turn on/off settings debug messages Review of attachment 8494279 [details] [diff] [review]: ----------------------------------------------------------------- ::: b2g/app/b2g.js @@ +507,4 @@ > > // WebSettings > pref("dom.mozSettings.enabled", true); > +pref("dom.mozSettings.debug", false); Hrm, I hate to quibble, but shouldn't this be s/debug/logging/ ? ::: dom/settings/SettingsManager.js @@ +4,4 @@ > > "use strict"; > > +const DEBUG = Services.prefs.getBoolPref("dom.mozSettings.debug"); So, doing things this way means that you have to restart before the pref change takes effect... Is that what you want, or should we try to live-update it?
Attachment #8494279 - Flags: review?(bent.mozilla) → review+
Target Milestone: 2.1 S5 (26sep) → ---
Dup'd and done better by bug 1106896
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: