Re: NSLog err and debug?
Re: NSLog err and debug?
- Subject: Re: NSLog err and debug?
- From: Jonathan Rochkind <email@hidden>
- Date: Wed, 26 Mar 2003 16:04:18 -0600
Thanks! So I'm seeing that NSLog.err and NSLog.debug are by default the
same location---System.err. But you can redefine them to whatever you want.
As far as my own code... I'm still not exacty sure what the difference is
between debugging messages and error message, I'm not sure what messages I
want to consider one and what I want to consider the other. But if by
defualt NSLog.err and NSLog.debug are the same place anyway, I won't worry
too much about it.
Thanks for the advice about always outputting NSLog.err messages, but
conditionally outputting NSLog.debug messages. That makes sense, now that I
hear it.
At 10:59 AM 3/26/2003 -1000, Art Isbell wrote:
On Wednesday, March 26, 2003, at 10:10 AM, Jonathan Rochkind wrote:
Under normal circumstances, where you haven't done anything to change the
defaults...
will NSLog.err.appendln and NSLog.debug.appendln go to the same place?
According to the NSLog javadoc, yes - to System.err.
What's the difference anyway?
I think by default, there is no difference.
Maybe debug will be output only depending on the debugging properties set
(but isn't it your responsibility to ensure that in your own code, by
checking NSLog.debuggingAllowedFor... ?) but err will always be output?
I suppose one must distinguish between controlling the output
from 3rd-party code vs. one's own code. You have no control over what
messages 3rd-party code makes available but only what you want to accept
using launch flags. A developer might condition the output to NSLog.err
based on debug level and/or debug group, but I would think that best
practice might be to output NSLog.err unconditionally and reserve
conditional output for NSLog.debug.
Or are they exactly the same unless you set err or debug to be something
different?
Because both NSLog.debug and NSLog.err exist and their output
destination can be changed independently, this does provide the
flexibility of being able to separate NSLog.debug and NSLog.err output
destinations, if desired.
When should I use one and when the other for console/log output?
In your own code, you can output debugging messages to
NSLog.debug and error messages to NSLog.err. If you want these output
streams to go somewhere other than System.err (e.g., a log file), you can
do that as well.
Aloha,
Art
_______________________________________________
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.