Closed Bug 881672 Opened 11 years ago Closed 11 years ago

Enabling a DUMP function for all Gaia apps

Categories

(Firefox OS Graveyard :: Gaia, defect)

x86_64
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(blocking-b2g:leo+, b2g18 fixed, b2g-v1.1hd fixed)

RESOLVED FIXED
blocking-b2g leo+
Tracking Status
b2g18 --- fixed
b2g-v1.1hd --- fixed

People

(Reporter: frsela, Assigned: frsela)

References

Details

Attachments

(1 file)

We should have a generic way to enable/disable DEBUG traces in Gaia. The approach can be enabling a DUMP function for all Gaia apps : • one pref to rule them all (e.g. `debug.gaia.enabled') — we could even make it true by default on non-production builds; • one shared library (`shared/js/debug/js') to expose a DUMP object that we’d use like a `console.log()' or a `dump()'; • replace all current `console.log()' calls in Gaia by a DUMP() call. In order to make this debug data easier to grep, this DUMP() function would automatically prepend the application name (e.g. relying on document.location) in the console.log message.
This bug comes from the discussion in bug 875679 and the attachment https://bugzilla.mozilla.org/attachment.cgi?id=759685. Related comments: #5, #6, #7 and #9
Assignee: nobody → frsela
blocking-b2g: --- → leo?
Quite a few STK-related issues are blocking (leo+) and are difficult to reproduce on development builds; to fix these blockers, our testers need a way to enable DEBUG traces without having to flash their device. Of course, this patch would help debugging all Gaia apps — not only the STK features; but as it’d help debugging open leo+ issues, I tend to think we should address this bug ASAP, leo+ or not.
One thing I would like to see here is an approach that QA can take full advantage of during daily testing. The global preference is definitely a good idea to consider.
Examples in system and settings here: System: https://github.com/frsela/gaia/compare/STK;Bug881672_SystemApp Settings: https://github.com/frsela/gaia/compare/STK;Bug881672_SettingsApp Kaze, I suppose each app should be modified in a different patch but ¿one independent bug per app? or we can collect all patches here?
Attachment #761327 - Flags: review?(kaze)
Flags: needinfo?(kaze)
I think it’s safer to open one patch per app and make them depend on this bug. Obviously we want the Settings and System patches first.
Flags: needinfo?(kaze)
Comment on attachment 761327 [details] Adding shared Gaia debug class I’m not sure this is the best approach. Let’s discuss that on your pull request.
Comment on attachment 761327 [details] Adding shared Gaia debug class Clearing the review flag, please r? me again when ready.
Attachment #761327 - Flags: review?(kaze)
Is this enabled for 3rd party apps too? Could a 3rd party app dumpflood the phone?
No, unless the 3rd-party app includes the shared debug.js lib and has settings privileges. However, as long as console.log() is enabled, console flooding is possible (and easy). Maybe we need a way to disable console.[log|warn|error] calls, but that’s outside of the scope of this patch.
Let's patch our local builds, but not take any extra risk for 1.1 at this point.
blocking-b2g: leo? → -
Blocks: 875679
Comment on attachment 761327 [details] Adding shared Gaia debug class r=me, please squash your commits before merging.
Attachment #761327 - Flags: review?(kaze) → review+
Landed: 5d6fbaa19afc6e15aa8449d6ba5e4a3cb680b0ec
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
(In reply to Alex Keybl [:akeybl] from comment #10) > Let's patch our local builds, but not take any extra risk for 1.1 at this > point. The problem is, patching local builds didn’t work so far. That’s why Fernando proposed a way to enable these traces directly from Gaia, and I agree it’s necessary to have these before refactoring the whole STK/ICC code base — which is a leo+ task. This library doesn’t add any risk because it’s not used by any other Gaia app at the moment. I would like to uplift it to v1-train in order to enable STK/ICC testing.
So we re-nominate this bug to leo, as mentioned, it is important to quickly uplift it to v1-train in order to test STK/ICC patches
blocking-b2g: - → leo?
Blocks: 880356
Blocks: 880351
Blocks: 880352
Blocks: 880353
Blocks: 880346
Blocks: 880333
Blocks: 880339
Blocks: 880337
blocking-b2g: leo? → leo+
Uplifted 5d6fbaa19afc6e15aa8449d6ba5e4a3cb680b0ec to: v1-train: 74684bda85753fcedcceb128ef1dca9ff3071f54
1.1hd: 74684bda85753fcedcceb128ef1dca9ff3071f54
Flags: in-moztrap-
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: