[MAGNOLIA-353] Using if statements before log4j calls Created: 28/Apr/05 Updated: 10/May/05 Resolved: 10/May/05 |
|
| Status: | Closed |
| Project: | Magnolia |
| Component/s: | core |
| Affects Version/s: | 2.1 Final |
| Fix Version/s: | 2.1 Final |
| Type: | Improvement | Priority: | Minor |
| Reporter: | Nicolas Modrzyk | Assignee: | Sameer Charles |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Template: |
|
| Acceptance criteria: |
Empty
|
| Task DoD: |
[ ]*
Doc/release notes changes? Comment present?
[ ]*
Downstream builds green?
[ ]*
Solution information and context easily available?
[ ]*
Tests
[ ]*
FixVersion filled and not yet released
[ ] 
Architecture Decision Record (ADR)
|
| Date of First Response: |
| Description |
|
It would be nice to follow the followin: if(logger.isDebugEnabled() { logger.debug("Entry number: " + i + " is " + String.valueOf(entry[i])); }That would actually minimize the cost of logging in production environment. I could also work on it whenever ... |
| Comments |
| Comment by Boris Kraft [ 28/Apr/05 ] |
|
I doubt that this is a big hit on performance. Messure before you optimize. And use log4j config to turn off the writing of these messages if you don't need them. I think that generally the additional code clutter is not worth the benefit. In places where code is iterated over heavily, I suggest that devs use the suggested pattern at their descretion. |
| Comment by Sameer Charles [ 28/Apr/05 ] |
|
Its true that it wont log it if debug is not enabled BUT, it will still compute the parameter |
| Comment by Sameer Charles [ 10/May/05 ] |
|
added where necessary, from now on we will just have to take care whenever using loger |