Re: System.out.println

2004-08-06 Thread Woodchuck
thanks all for the input! i will look into this further, but the worse case would be to write a secret action named "woodchuckshouldbetheonlyonethatcallsthissecretaction.do" that should make it somewhat safe! :) hehehe --- Jason Lea <[EMAIL PROTECTED]> wrote: > > Log4j has configureAndWatch

RE: System.out.println

2004-08-06 Thread Richard Mixon (qwest)
Xavier Noria wrote: > On Aug 5, 2004, at 18:54, Woodchuck wrote: > >> what i thought was, if possible, it would be nice if we could somehow >> get the debug flag to read (poll) from some configuration file or >> something, so that we can change this configuration file to >> enable/disable logging (

Re: System.out.println

2004-08-05 Thread Jason Lea
Log4j has configureAndWatch which looks for changes to the configuration file. As for commons-logging it doesn't have it yet: http://www.mail-archive.com/[EMAIL PROTECTED]/msg10152.html So the other suggestion of having an action to reload or change the level is probably your best bet right now

Re: System.out.println

2004-08-05 Thread Xavier Noria
On Aug 5, 2004, at 18:54, Woodchuck wrote: what i thought was, if possible, it would be nice if we could somehow get the debug flag to read (poll) from some configuration file or something, so that we can change this configuration file to enable/disable logging (or even level of logging) in the app

RE: System.out.println

2004-08-05 Thread Jim Barrows
> -Original Message- > From: Woodchuck [mailto:[EMAIL PROTECTED] > Sent: Thursday, August 05, 2004 9:54 AM > To: Struts Users Mailing List > Subject: Re: System.out.println > > > hi Shinobu, > > thanks for your reply. sorry, but i meant arbitrarily (at

Re: System.out.println

2004-08-05 Thread Woodchuck
hi Shinobu, thanks for your reply. sorry, but i meant arbitrarily (at any time), rather than hard-coding logic in the code to toggle the debug flag at certain known situations. what i thought was, if possible, it would be nice if we could somehow get the debug flag to read (poll) from some con

Re: System.out.println

2004-08-05 Thread Shinobu Kawai
Hi Woodchuck, > how can we toggle the debug flag during runtime? is it possible? or > does it require restarting the application? Depends on how you implement it, I guess. I use commons-logging, which completely depends on the underlying logging framework; log4j by default. With log4j, you can

Re: System.out.println

2004-08-05 Thread Woodchuck
how can we toggle the debug flag during runtime? is it possible? or does it require restarting the application? --- Shinobu Kawai <[EMAIL PROTECTED]> wrote: > > if (debug) { > > System.out.println(veryComplicatedObject.veryExpensiveToString()); > } // Of course,

Re: System.out.println

2004-08-05 Thread Shinobu Kawai
f. And /that/ is when I would consider the trade off and clutter my code. :) if (debug) { System.out.println(veryComplicatedObject.veryExpensiveToString()); } // Of course, I use commons-logging instead. Best regards, -- Shinobu Kawai -- Shinobu Kawai <[EMAIL PROTECTED], [

Re: System.out.println

2004-08-05 Thread Xavier Noria
On Aug 5, 2004, at 12:32, Shinobu Kawai wrote: Without a benchmark, I would say that in a typical response there are *lots* of method calls from the ones in your code passing through Struts/Hibernate/etc. down to the Java library. Some of them non-trivial as the ones regarding persistence. If the c

RE: System.out.println

2004-08-05 Thread aditya
Well yes I agree. The debug method should be then made final. So that the compiler will inline it. -Original Message- From: Jesse Alexander (KXT) [mailto:[EMAIL PROTECTED] Sent: Thursday, August 05, 2004 4:14 PM To: 'Struts Users Mailing List' Subject: RE: System.out.println

RE: System.out.println

2004-08-05 Thread Jesse Alexander (KXT)
Sure makes a difference in readability! if (debug) { System.out.println(..); } versus debug(..); I think that can definitely render more readable a java-class. Or don't you so? hth Alexander -Original Message- From: aditya [mailto:[EMAIL PROTECTED] Sent: Thu

Re: System.out.println

2004-08-05 Thread Shinobu Kawai
Hi Xavier, > > I agree with u that those many if statements will clutter code. But a > > method call everytime is also expensive in terms of performance. So it > > is really a trade off between performance and > > Is the difference in performance really significative in a web > application? >

RE: System.out.println

2004-08-05 Thread aditya
ruts Users Mailing List' Subject: RE: System.out.println I think the actual compilers will optimize the method call resulting in an overhead which is not anymore measurable. I imagine they will inline the debug-method with the if and just call out for the actual println... Alexander -O

RE: System.out.println

2004-08-05 Thread Jesse Alexander (KXT)
PROTECTED] Sent: Thursday, August 05, 2004 11:37 AM To: Struts Users Mailing List Subject: Re: System.out.println On Aug 5, 2004, at 11:22, Aditya Athalye wrote: > I agree with u that those many if statements will clutter code. But a > method call everytime is also expensive in terms of performan

Re: System.out.println

2004-08-05 Thread Xavier Noria
On Aug 5, 2004, at 11:22, Aditya Athalye wrote: I agree with u that those many if statements will clutter code. But a method call everytime is also expensive in terms of performance. So it is really a trade off between performance and Is the difference in performance really significative in a web

RE: System.out.println

2004-08-05 Thread Aditya Athalye
PROTECTED] Sent: Thu 8/5/2004 2:47 PM To: Struts Users Mailing List Cc: Subject: Re: System.out.println On Aug 5, 2004, at 10:58, Aditya Athalye wrote: > U shld use a flag say debug. > > so the

Re: System.out.println

2004-08-05 Thread Xavier Noria
On Aug 5, 2004, at 10:58, Aditya Athalye wrote: U shld use a flag say debug. so the code will look like boolean debug = true; if(debug) System.out.println(" "); In production make the flag as false. Just out of curiosity. I see that pattern often, and find that "if" fo

RE: System.out.println

2004-08-05 Thread Aditya Athalye
U shld use a flag say debug. so the code will look like boolean debug = true; if(debug) System.out.println(" "); In production make the flag as false. Hope this helps Thanks Aditya -Original Message- From: Shailender Jain [mailto:[EMAIL

RE: System.out.println

2004-08-05 Thread tiwari.rajeev
onwards, any system.out.println will go to new destination and will not mix up with catlina.out file. But yup, for next project onwards, avoid using such blind printlns. Either use log4j or write your own logger with a flag as status. And write logg always with status (development, deployment, testing

Re: System.out.println

2004-08-05 Thread Matthew Ryan
Sinner. Implement Log4J, drop all the System.out.println's. http://logging.apache.org/log4j/docs/index.html On 5/8/04 4:18 PM, "Shailender Jain" <[EMAIL PROTECTED]> wrote: > Hi, > > During the development of the project we used System.out.println to do > the

Re: System.out.println

2004-08-05 Thread Sean Radford
Shailender Jain wrote: Hi, During the development of the project we used System.out.println to do the debugging. Now i want to put the application in production. But i want that some how this command should not populate the log files. (catalina.out). I am using jakarta-tomcat-5.0.16. Any pointer

System.out.println

2004-08-05 Thread Shailender Jain
Hi, During the development of the project we used System.out.println to do the debugging. Now i want to put the application in production. But i want that some how this command should not populate the log files. (catalina.out). I am using jakarta-tomcat-5.0.16. Any pointer regarding this will