Closed Bug 674493 Opened 13 years ago Closed 11 years ago

Improve console.* methods

Categories

(Add-on SDK Graveyard :: General, enhancement, P3)

enhancement

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: irakli, Assigned: irakli)

Details

Attachments

(1 file)

      No description provided.
Assignee: nobody → rFobic
Attachment #548737 - Flags: review?(myk)
Irakli: can you explain the reasoning behind this bug and the value of the fix?
Whiteboard: [triage:followup]
Sure!

I spend a lot of time while developing inspecting various things I'm working with using console.log or similar. Unfortunately it's pretty much useless though as only thing I get is "[object Object]". So usually I end up going through all my console.* calls replacing it with something like:

console.log(Object.keys(value).map(function(key) key + ':' + value[key]).join('\n'))

This change improves console.* methods so that output dumped is far more informative.

console.log(Object.create({ a: 'a' }, {
  b: { value: function b(a, b) {
     // some source
  }}
}) 

prints something like

{ // [object Object]
  b: function b(a, b) { .... } // readable writable enumerable
  __proto__: {
    a: 'a'    // readable writable enumerable
  }
}
It terms of value it would save a lot of time at least for me and I'd expect others as well.
Severity: normal → enhancement
OS: Mac OS X → All
Priority: -- → P3
Hardware: x86 → All
Whiteboard: [triage:followup]
Target Milestone: --- → 1.2
Comment on attachment 548737 [details]
Pointer to Github pull request: https://github.com/mozilla/addon-sdk/pull/209

The full review is in the pull request.  Significant issues include:

1. lack of license headers;
2. lack of commentary;
3. exceptions being red-on-red.
Attachment #548737 - Flags: review?(myk) → review-
(Pushing all open bugs to the --- milestone for the new triage system)
Target Milestone: 1.2 → ---
This that we use devtools console this is obsolete.
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: