Closed
Bug 954116
Opened 11 years ago
Closed 11 years ago
Reduce the amount of data the twitter plugin logs into the Error Console
Categories
(Chat Core :: Debug, defect)
Chat Core
Debug
Tracking
(Not tracked)
RESOLVED
FIXED
1.0
People
(Reporter: florian, Assigned: clokep)
References
Details
(Whiteboard: [0.3-blocking-final])
Attachments
(1 file, 2 obsolete files)
(deleted),
patch
|
clokep
:
review+
|
Details | Diff | Splinter Review |
*** Original post on bio 681 at 2011-02-04 13:20:00 UTC ***
Currently all the data from the twitter plugin (requests sent, received response) is logged. That's sometimes huge messages in the error console, and they are not really human readable.
The messages come from the HTTP request implementation in jsProtoHelper, that uses the LOG function.
I think that function should use a preference to determine what to do with logged debug data.
Reporter | ||
Updated•11 years ago
|
Whiteboard: [0.3-blocking]
Assignee | ||
Comment 1•11 years ago
|
||
*** Original post on bio 681 at 2011-02-16 15:19:26 UTC ***
This would be useful to all protocols to make the LOG command be able to handle debug levels, etc.
Summary of ideas from IRC:
All js protocol plugins can call LOG with some debug junk, and preferences to select which junk should appear (all, none, only important messages, only one protocol, ...)
flo suggested: maybe just put the LOG function of jsProtoHelper into an Utils exported object, and then at the top of each protocol plugin code: const LOG = Utils.LOG.bind(null, "IRC");
Reporter | ||
Updated•11 years ago
|
Whiteboard: [0.3-blocking] → [0.3-blocking-final]
Assignee | ||
Comment 2•11 years ago
|
||
*** Original post on bio 681 at 2011-06-07 23:01:22 UTC ***
The plan is to make a simple LOG command that checks the purple logging pref: http://lxr.instantbird.org/instantbird/source/instantbird/app/profile/all-instantbird.js#293
Assignee: nobody → clokep
Status: NEW → ASSIGNED
Assignee | ||
Comment 3•11 years ago
|
||
*** Original post on bio 681 as attmnt 709 at 2011-06-14 23:35:00 UTC ***
This adds a DEBUG, LOG, WARN and ERROR statement that abide by the purple.debug.loglevel preference.
WARN and ERROR include the line number and file.
Attachment #8352451 -
Flags: review?(florian)
Assignee | ||
Comment 4•11 years ago
|
||
*** Original post on bio 681 at 2011-06-15 02:10:08 UTC ***
Comment on attachment 8352451 [details] [diff] [review] (bio-attmnt 709)
Patch
>+ // Log a warning or error with a line number and file.
>+ // Take the caller of this function and extract the line number and file.
>+ let matches = /^(.+)@(.+):(\d+)$/.exec((new Error).stack.split("\n")[2]);
Also, I just wanted to comment that as messed up as this looks...as far as I can tell this is the "correct" way to get a decent stack trace in JavaScript. Let me know if the comment needs to be expanded.
Reporter | ||
Comment 5•11 years ago
|
||
*** Original post on bio 681 as attmnt 711 at 2011-06-15 13:18:00 UTC ***
After some discussion on IRC and several iterations, I think this is what we agreed on.
Attachment #8352453 -
Flags: review?(clokep)
Reporter | ||
Comment 6•11 years ago
|
||
Comment on attachment 8352451 [details] [diff] [review]
Patch
*** Original change on bio 681 attmnt 709 at 2011-06-15 13:18:36 UTC was without comment, so any subsequent comment numbers will be shifted ***
Attachment #8352451 -
Attachment is obsolete: true
Attachment #8352451 -
Flags: review?(florian)
Reporter | ||
Comment 7•11 years ago
|
||
*** Original post on bio 681 as attmnt 712 at 2011-06-15 13:21:00 UTC ***
Let's attach the right patch this time :)
Attachment #8352454 -
Flags: review?(clokep)
Reporter | ||
Comment 8•11 years ago
|
||
Comment on attachment 8352453 [details] [diff] [review]
Patch v2
*** Original change on bio 681 attmnt 711 at 2011-06-15 13:21:06 UTC was without comment, so any subsequent comment numbers will be shifted ***
Attachment #8352453 -
Attachment is obsolete: true
Attachment #8352453 -
Flags: review?(clokep)
Assignee | ||
Comment 9•11 years ago
|
||
Comment on attachment 8352454 [details] [diff] [review]
Patch v2
*** Original change on bio 681 attmnt 712 at 2011-06-15 13:33:22 UTC ***
Looks good! I like this a lot better than what I had.
Removing the "Error: " is up to you, but it's probably not necessary anymore. Can't wait to convert my JS-IRC to use this! Thanks for cleaning it up.
Attachment #8352454 -
Flags: review?(clokep) → review+
Reporter | ||
Comment 10•11 years ago
|
||
*** Original post on bio 681 at 2011-06-15 18:00:49 UTC ***
https://hg.instantbird.org/instantbird/rev/f6ae36370e55
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → 1.0
You need to log in
before you can comment on or make changes to this bug.
Description
•