airavata-courses / TeamZenith

Team Zenith Repository for Spring 2016 I590 Class
2 stars 4 forks source link

Logging standard practice #7

Closed ajinkya-dhamnaskar closed 8 years ago

ajinkya-dhamnaskar commented 8 years ago

String operations are heavy, so to avoid expensive concatenation operations in log messages, it is always preferred to check log level before logging. So, lets say if we need to log message at debug level one should check for log.isDebugEnabled() first. This way we can avoid calculating log string if that particular log level is not enabled. No need to check for error logs as error is the base log level.

a2l007 commented 8 years ago

We have fixed this in milestone 2. Thanks for pointing out.