-
15. Re: Issues moving from Seam 1.1.0 to Seam 1.1.5
gavin.king Feb 7, 2007 7:50 PM (in response to bsmithjj)I agree that under no circumstances should the log throw an exception back to application code. (Even though this was definitely a case of wrong usage...)
-
16. Re: Issues moving from Seam 1.1.0 to Seam 1.1.5
bsmithjj Feb 7, 2007 8:33 PM (in response to bsmithjj)definitely a case of wrong usage
?
Last summer at JBoss world, when you first presented this, I was under the impression that you were offering @Logger as an annotation based replacement for the usual commons logging stuff:private Log log = LogFactory.getLog(MyClass.class);
I guess I misunderstood or misheard something about how @Logger should be used. Anyway, as I said, I can revert to the 'old' way with commons logging. I didn't realize that I would be forced to change the way I write my logging statements and that I would be wrong if I didn't (when using @Logger. Lesson learned....
Thanks -
17. Re: Issues moving from Seam 1.1.0 to Seam 1.1.5
gavin.king Feb 7, 2007 8:44 PM (in response to bsmithjj)The point of this is to get rid of crap like:
private static final Log log = LogFactory.getLog(Customer.class);
if ( log.isDebugEnabled() ) { log.debug("deleting customer " + customer.getName() + " in region " + customer.getRegion()); }
And let you use:@Logger private static final Log log;
log.debug("deleting customer #{customer.name} in region #{customer.region}");
I don't know about you, but I think thats a *significant* improvement in readability.
I don't think we did a bad job on this. -
18. Re: Issues moving from Seam 1.1.0 to Seam 1.1.5
smokingapipe Feb 7, 2007 9:08 PM (in response to bsmithjj)In my experience, I end up deleting most of my logging statements as I finish pieces of code. They help me a lot when I'm trying to get the basic code going. I might put 5 log statements in a simple method sometimes, if I really can't figure out why it's not working. After I get it fixed I then take those out; whatever software bug I had in there won't be coming back. So I never use the if(logLevel == DEBUG) idiom. And I always use the java.util.logging classes, because I know they will be there, no matter what is or is not on the classpath, or no matter what kind of classloader problems might be happening.
-
19. Re: Issues moving from Seam 1.1.0 to Seam 1.1.5
norman.richards Feb 7, 2007 10:03 PM (in response to bsmithjj)"gavin.king@jboss.com" wrote:
I agree that under no circumstances should the log throw an exception back to application code. (Even though this was definitely a case of wrong usage...)
Just don't call it with more than 10 arguments then. :) -
20. Re: Issues moving from Seam 1.1.0 to Seam 1.1.5
gavin.king Feb 7, 2007 10:07 PM (in response to bsmithjj)LOL
-
21. Re: Issues moving from Seam 1.1.0 to Seam 1.1.5
raghinii Feb 8, 2007 8:25 PM (in response to bsmithjj)heh. i'm surprised at the hostility towards this log. I really like not having to add the isDebugEnabled() guard around my debug statements to save the string building.
beyond that, the formatting comes for free. Before i would just use String.format in my normal log4j logger messages.
As far as logging during development, i usually just attach a debugger and do it that way. I find it to be a much faster method most of the time. I only wish i could do the same through the pages...