Closed
Bug 971255
Opened 12 years ago
Closed 12 years ago
[AccessFu] Make it easier to run code conditional on debug log level
Categories
(Core :: Disability Access APIs, defect)
Core
Disability Access APIs
Tracking
()
RESOLVED
FIXED
mozilla30
People
(Reporter: eeejay, Assigned: eeejay)
Details
Attachments
(1 file, 1 obsolete file)
|
6.35 KB,
patch
|
yzen
:
review+
|
Details | Diff | Splinter Review |
No description provided.
| Assignee | ||
Comment 1•12 years ago
|
||
Why is this better than a simple if statement? Not sure.. maybe I like it becuase it encapsulates the logLevel a bit further..
Attachment #8374424 -
Flags: review?(yzenevich)
Comment 2•12 years ago
|
||
Comment on attachment 8374424 [details] [diff] [review]
[AccessFu] Introduce Logger.doIfDebug
Review of attachment 8374424 [details] [diff] [review]:
-----------------------------------------------------------------
It looks good, but since we always call Logger.debug inside Logger.doIfDebug, lets make Logger.debug do the check internally. We won't need doIfDebug at all in that case.
| Assignee | ||
Comment 3•12 years ago
|
||
We already check the loglevel in debug(), the reason we still need to do it conditionally is because we making the strings to log is often not trivial, like accessibleToString, or other operations that we are only interested in performing when we are debugging, but not in production code.
| Assignee | ||
Comment 4•12 years ago
|
||
Attachment #8374424 -
Attachment is obsolete: true
Attachment #8374424 -
Flags: review?(yzenevich)
Attachment #8375067 -
Flags: review?(yzenevich)
Comment 5•12 years ago
|
||
Comment on attachment 8375067 [details] [diff] [review]
[AccessFu] Allow providing a callable argument to Logger log calls.
Review of attachment 8375067 [details] [diff] [review]:
-----------------------------------------------------------------
awesome r=me with 1 nit.
::: accessible/src/jsat/Utils.jsm
@@ +352,5 @@
> return;
>
> + let args = Array.prototype.slice.call(arguments, 1);
> + let message = typeof(args[0]) === 'function' ?
> + args[0]().join(' ') : args.join(' ');
Nit:
let message = (typeof(args[0]) === 'function' ? args[0]() : args[0]).join(' ');
Attachment #8375067 -
Flags: review?(yzenevich) → review+
| Assignee | ||
Comment 6•12 years ago
|
||
Assignee: nobody → eitan
Comment 7•12 years ago
|
||
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla30
You need to log in
before you can comment on or make changes to this bug.
Description
•