Ticket #2527846 (accepted enhancement)
Reporter Satyam |
Opened: 04/12/09 Last modified: 04/26/11 Status: accepted Type: enhancement |
Owner Dav Glass |
Target Release: FUTURE Priority: P3 (normal) |
|---|---|---|---|
| Summary: | Add method logIf | ||
| Description: | Sometimes you want to log a message is certain condition is met. Like: if (<condition>) Y.log('something'); In the minified version, the code ends up: if(<condition>){} A logIf method could be used: Y.logIf(<condition>,'something'); and then have the whole stripped when creating the raw version. |
||
| Type: | enhancement | Observed in Version: | 3.0.0 PR2 |
| Component: | YUI Global Object | Severity: | S3 (normal) |
| Assigned To: | Dav Glass | Target Release: | FUTURE |
| Location: | Library Code | Priority: | P3 (normal) |
| Tags: | Relates To: | ||
| Browsers: | N/A | ||
| URL: | |||
| Test Information: | |||
Change History
|
Posted: 05/14/09
|
|
Posted: 05/14/09
Good idea, and it would be a trivial method to add. But it isn't trivial to scrub out during the build process. The variations that might be supplied for the condition is likely to trip up the regexp we are using for this. And when the log stripper breaks, it generally breaks the file -- usually in a sinister, ugly, sneaky manner that could invalidate a release. I'll take a look at how we might make this safer. |
|
Posted: 07/7/09
A similar request against YUI2 puts this functionality into a stubbed out assert function, which I think is better than logIf: http://yuilibrary.com/projects/yui2/ticket/1959024 |
|
Posted: 04/20/11
|
|
Posted: 04/26/11
|
This sounds like a great extension. Since logging is initiated at the Y instance level, I'm moving this to YUI Global and reassigning. I'll let Adam make the decision as to whether it's a better fit for core or a separate optional module.