[ https://issues.apache.org/jira/browse/KAFKA-193?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13148985#comment-13148985 ]
Joe Stein commented on KAFKA-193: --------------------------------- Well, error and fatal have overloaded for throwable since existing code used this... error(e) can still be done the old way (I was coding to keep consistent but we can improve some too) Yes, toString() on the throwable object just is a short description, the message, yup. Bad (my opinion) debug(m: => String) did not get debug(m: => Throwable) because no one was doing that yet in the code. as far as good, my preference/opinion is if you are going to log something to make it useful and informational. stack traces are best if we accept throwable for every level we could always take that object and do getStackTrace().toString() http://download.oracle.com/javase/6/docs/api/java/lang/Throwable.html#getStackTrace() and then log that result underneath them e.g. def debug(e: => Throwable): Any = { logger.debug(e.getStackTrace().toString()) } so folks can do error(e) and we can still get what we want/need in the logs so how about I change all of the levels in LogHelper to accept throwable as a paramater and to use this stacktrace extraction and to string that for logging? anything else? > use by name parameter helper for logging and trait to include lazy logging > and refactor code to use the new LogHelper > --------------------------------------------------------------------------------------------------------------------- > > Key: KAFKA-193 > URL: https://issues.apache.org/jira/browse/KAFKA-193 > Project: Kafka > Issue Type: Improvement > Affects Versions: 0.7 > Reporter: Joe Stein > Fix For: 0.8 > > Attachments: kafka-193.patch > > > 1) New tait to include logging and helper methods so if > (log.isDebugEnabled()) is not required because it is in the helper and log > paramaters are passed by name so not executed to tidy up the code > 2) refactor all occurrence of logging to use the log helper > 3/4 (possibly to be handled in to tickets) the "lint" affect from this for > changes patched but not on trunk and new patches moving forward until this is > baked in -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira