Re: automating NSLog events - an on off switch
Re: automating NSLog events - an on off switch
- Subject: Re: automating NSLog events - an on off switch
- From: Michael Engelhart <email@hidden>
- Date: Sat, 10 Jan 2004 08:30:16 -0500
Use a logging package! Almost every major open source Jakarta project
uses Log4J to log debugging information. Log4J allows you to set the
level of output at runtime by using a logging hierarchy so that you can
have verbose logging when you're trying to debug and then just
informational log output when you deploy. It comes with a variety of
logging classes that allow everything from simple logging to a file to
automatic log rollover by date or filesize as, XML logging output as
well as more esoteric uses like logging to an SMTP server if you're
unable to watch the log file from a terminal for example or want only
high level errors to be emailed to you even after a site has been
deployed.
You can find out more here:
http://logging.apache.org/log4j/docs/
There's also a side project called Chainsaw which is a java based GUI
log viewer that has an incredible array of features so you don't always
have to use tail -f somelog.log or whatever you normally use to view
logs.
Log4J is just my preference though and the latest JDK has it's own
logging system but I haven't used it. I would take a look and find
out what one works best for you.
Mike
On Jan 9, 2004, at 11:27 PM, Art Isbell wrote:
On Jan 9, 2004, at 5:21 PM, Jonathan Fleming wrote:
Has anyone done or does anyone know how to automate an
NSLog.out.appendln( "message" ) so that it can be switched on or off
from an action or other more suitable place when either in development
or deployment?
I'm getting tired of building apps with so many methods giving me an
NSLog readout when I'm developing only to have to then go around the
app through all the classes to turn off those that may be unnecessary
in deployment.
Don't add NSLog debugging statements in the first place but instead
use the Java debugger to track values. Just set breakpoints where you
want to look at the state of things. Adding print statements for
debugging when a debugger is available doesn't make much sense and
makes one's code pretty ugly.
Aloha,
Art
[demime 0.98b removed an attachment of type
application/pkcs7-signature which had a name of smime.p7s]
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.