• 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: Logging Mechanisms in Cocoa
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Logging Mechanisms in Cocoa
      • From: "Clint Shryock" <email@hidden>
References: 
 >Logging Mechanisms in Cocoa (From: JanakiRam <email@hidden>)

  • Prev by Date: Re: Use of Mac OS X 10.5 / Leopards Garbage Collection Considered Harmful
  • Next by Date: Re: Server Address from Mounted SMB Volume
  • Previous by thread: Re: Logging Mechanisms in Cocoa
  • Next by thread: Re: Logging Mechanisms in Cocoa
  • Index(es):
    • Date
    • Thread