• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Name of current function/selector
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Name of current function/selector (From: Lawrence Sanbourne <email@hidden>)
 >Re: Name of current function/selector (From: Pontus Ilbring <email@hidden>)
 >Re: Name of current function/selector (From: Andy Lee <email@hidden>)

  • Prev by Date: Re: Dynamically changing an application's icon / Adding a badge
  • Next by Date: Re: Killing a daemon process
  • Previous by thread: Re: Name of current function/selector
  • Next by thread: Re: Name of current function/selector
  • Index(es):
    • Date
    • Thread