If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

"bind" entire AndroidLog module to a tag

RESOLVED FIXED in Firefox 34

Status

()

Firefox for Android
General
--
enhancement
RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: myk, Assigned: myk)

Tracking

unspecified
Firefox 34
All
Android
Points:
---
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

3 years ago
Created attachment 8464727 [details] [diff] [review]
patch v1: "bind" entire AndroidLog module

It'd be handy to be able to "bind" the entire AndroidLog module to a tag, so you don't have to specify a tag each time you call one of its functions:

  let Log = Cu.import("resource://gre/modules/AndroidLog.jsm", {}).AndroidLog.bind("MyModule");
  Log.d("This is a debug message.");
  // Outputs "D/GeckoMyModule(#####): This is a debug message."

The "bind" function isn't Function.bind, as this is an object, not a function.  But it does for the object what Function.bind does for its individual functions.  So I figured it would make sense.  Commence bikeshedding at your leisure!

(I once implemented a preferences API that let you access prefs via both a root Prefs object and Prefs("branch") instances, which is roughly equivalent to what this provides; but that API was a bit subtle, too clever; this one seems better.)
Attachment #8464727 - Flags: review?(mark.finkle)
Comment on attachment 8464727 [details] [diff] [review]
patch v1: "bind" entire AndroidLog module

nice
Attachment #8464727 - Flags: review?(mark.finkle) → review+
(Assignee)

Comment 2

3 years ago
https://hg.mozilla.org/integration/fx-team/rev/2cc8ef816748
https://hg.mozilla.org/mozilla-central/rev/2cc8ef816748
Status: ASSIGNED → RESOLVED
Last Resolved: 3 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → Firefox 34
You need to log in before you can comment on or make changes to this bug.