• 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: Comparing Run Logs?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Comparing Run Logs?
      • From: email@hidden
References: 
 >Comparing Run Logs? (From: email@hidden)
 >Re: Comparing Run Logs? (From: email@hidden)

  • Prev by Date: Re: Comparing Run Logs?
  • Next by Date: Core Data Help
  • Previous by thread: Re: Comparing Run Logs?
  • Next by thread: Re: Comparing Run Logs?
  • Index(es):
    • Date
    • Thread