• 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: Leave NSLog()s in Final Product? - solution
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Leave NSLog()s in Final Product? - solution


  • Subject: Re: Leave NSLog()s in Final Product? - solution
  • From: Chaz McGarvey <email@hidden>
  • Date: Tue, 16 Mar 2004 22:41:10 -0700

On Mar 16, 2004, at 9:48 PM, Jerry Krinock wrote:

on 04/03/13 10:30, Chris Hanson at email@hidden wrote:

A better idea might be to switch to Bob Frank's Log4Cocoa framework
<http://log4cocoa.sourceforge.net/>

I looked at this and decided that I did not want to embed such a huge,
"full-featured" logger in my little application. So I wrote these two
functions to use instead of NSLog. They have a couple neat tricks in them,
so I thought I'd post them here.

The first one takes a C string, and the second takes an NSString, (for Obj-C
gurus who can't type a string constant any more without the "@" prefix).

[snip]

These functions look pretty much the same as the ones I wrote only mine are even a bit simpler. I've discovered that I don't want to have to hassle with log 'priorities' (or don't really care), so my functions are controlled by a global boolean value, which is set by one control function. Either I want to see log messages or I don't. This works well for me since I know for sure that I don't want any debug information to be printed to the console. Plus it would be easy to enable logging as a result of command-line parameters or user defaults. And life is good and simple. But your solution is great if you need priorities.

Chaz McGarvey
http://www.brokenzipper.com
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


References: 
 >Re: Leave NSLog()s in Final Product? - solution (From: Jerry Krinock <email@hidden>)

  • Prev by Date: Re: [Q] mapping graphical items to NSViews
  • Next by Date: multiple views with segmented control
  • Previous by thread: Re: Leave NSLog()s in Final Product? - solution
  • Next by thread: Re: Leave NSLog()s in Final Product? - solution
  • Index(es):
    • Date
    • Thread