Re: Name of current function/selector
Re: Name of current function/selector
- Subject: Re: Name of current function/selector
- From: Frode <email@hidden>
- Date: Sun, 23 Oct 2005 16:07:21 +0200
Hello!
2005-10-22 kl. 19.25 skrev Andy Lee:
#define DIGSLogError(format, ...)\
if (DIGSGetVerbosityLevel() >= DIGS_VERBOSITY_ERROR)\
{\
NSLog(\
[@"[_ERROR_] " stringByAppendingString:(format)],\
## __VA_ARGS__);\
}
/*!
* @function DIGSLogWarning
* @discussion Logs output if verbosity level >=
DIGS_VERBOSITY_WARNING.
*/
#define DIGSLogWarning(format, ...)\
if (DIGSGetVerbosityLevel() >= DIGS_VERBOSITY_WARNING)\
{\
NSLog(\
[@"[_WARNING_] " stringByAppendingString:(format)],\
## __VA_ARGS__);\
}
/*!
* @function DIGSLogInfo
* @discussion Logs output if verbosity level >= DIGS_VERBOSITY_INFO.
*/
#define DIGSLogInfo(format, ...)\
if (DIGSGetVerbosityLevel() >= DIGS_VERBOSITY_INFO)\
{\
NSLog(\
[@"[_INFO_] " stringByAppendingString:(format)],\
## __VA_ARGS__);\
}
/*!
* @function DIGSLogDebug
* @discussion Logs output if verbosity level >= DIGS_VERBOSITY_DEBUG.
*/
#define DIGSLogDebug(format, ...)\
if (DIGSGetVerbosityLevel() >= DIGS_VERBOSITY_DEBUG)\
{\
NSLog(\
[@"[_DEBUG_] " stringByAppendingString:(format)],\
## __VA_ARGS__);\
}
You should consider prepending "do { ... } while(0)" around the
if-statement, otherwise you might get unexpected results that are not
so obivious to track down.
Regards
/Roger
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden