Re: NSLog err and debug?
Re: NSLog err and debug?
- Subject: Re: NSLog err and debug?
- From: Art Isbell <email@hidden>
- Date: Wed, 26 Mar 2003 10:59:38 -1000
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.