• 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: NSLog() without the timestamp?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSLog() without the timestamp?


  • Subject: Re: NSLog() without the timestamp?
  • From: Jens Alfke <email@hidden>
  • Date: Tue, 09 Aug 2011 09:53:42 -0700

On Aug 9, 2011, at 9:30 AM, William Squires wrote:

> Is there a function like NSLog() that doesn't print the timestamp (and other crap) and doesn't automatically append a '\n' at the end? If not, what would be the best way to implement such a function. Trouble is, printf() doesn't understand the %@ specifier, so that approach would be a PITA.

fputs(stderr, [[NSString stringWithFormat: @“The count is %u”, count] UTF8String]);

Wrap that in a function if you don’t want to type it every time :)

(Even if you go with something else, make sure it writes to stderr not stout. Stdout gets buffered, so it’s much less useful for logging.)

—Jens

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

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

References: 
 >NSLog() without the timestamp? (From: William Squires <email@hidden>)

  • Prev by Date: Re: Frameworks (ConnectionKit)
  • Next by Date: Re: Frameworks (ConnectionKit)
  • Previous by thread: Re: NSLog() without the timestamp?
  • Next by thread: IKImageBrowserView
  • Index(es):
    • Date
    • Thread