Re: Logging Mechanisms in Cocoa
Re: Logging Mechanisms in Cocoa
- Subject: Re: Logging Mechanisms in Cocoa
- From: Nir Soffer <email@hidden>
- Date: Fri, 8 Feb 2008 02:39:26 +0200
On Feb 7, 2008, at 21:15, JanakiRam wrote:
I'm porting windows application to Mac using Cocoa. Now i
need to
implement the Logging ( NSLog/printf's with some trace levels ) in
Cocoa.
Can any one clarify my following queries.
i) Are there any open source Logging Frameworks in Cocoa ?
ii) If not , please provide some guidelines on implementing
in it
using Cocoa/
The simplest solution: use NSLog.
Little more fancy - wrap NSLog in macros:
#ifdef DEBUG
#define Debug(format, ...) NSLog(@"<Debug>: " format,
##__VA_ARGS__)
#else
#define Debug(format, ...)
#endif
#define Warn(format, ...) NSLog(@"<Warning>: " format, ##__VA_ARGS__)
#define Error(format, ...) NSLog(@"<Error>: " format, ##__VA_ARGS__)
See also http://www.borkware.com/rants/agentm/mlog/
Best Regards,
Nir Soffer
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden