Re: Comparing Run Logs?
Re: Comparing Run Logs?
- Subject: Re: Comparing Run Logs?
- From: Andy Lee <email@hidden>
- Date: Wed, 7 Mar 2007 17:25:24 -0500
On Mar 7, 2007, at 4:59 PM, email@hidden wrote:
void MYLog(enum LogCode lc, NSString *format, ...) {
// NSLog(format, ...);
}
I forget why (probably a trivial efficiency thing), but I do it with
a macro rather than a function. If I understand your intentions, I'd
do it with three separate macros rather than pass a LogCode as an
argument, something like this:
#define MYLogAny(format, ...)\
NSLog(\
[@"[MYLogAny] " stringByAppendingString:(format)],\
## __VA_ARGS__);
#define MYLogOther(format, ...)\
NSLog(\
[@"[MYLogOther] " stringByAppendingString:(format)],\
## __VA_ARGS__);
#define MYLogThreadState(format, ...)\
NSLog(\
[@"[MYLogThreadState] " stringByAppendingString:(format)],\
## __VA_ARGS__);
I have a similar set of macros, except it's one for each level of log
verbosity (DEBUG, INFO, WARN, etc.). Feel free to grab my source:
http://homepage.mac.com/aglee/downloads/AppKiDo-0.962-src.tgz. The
NSLog-wrapping stuff is in DIGSLog.h and DIGSLog.m.
--Andy
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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