• 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: Jens Alfke <email@hidden>
  • Date: Sun, 10 Feb 2008 19:57:41 -0800


On 10 Feb '08, at 5:42 PM, Timothy Reaves wrote:

Not sure you've ever used NSLog() Jens.

Heh. I spent seven years writing Cocoa apps and frameworks at Apple.

By default, in a running application, it does indeed send to the system log file, not just stdout or stderr.

It's complicated. In 10.4 and earlier, NSLog literally did just write to stderr. When the system launched a new application, it connected stderr (and stdout) to the file "console.log". So the effect of NSLog was normally to write to console.log. (Unless you launched it from Xcode or a shell.)


In Leopard, there is no more console.log. Instead, NSLog calls ASL. This writes to the ASL database and system.log. (Stderr output gets caught by launchd and echoed to ASL, though in kind of an ugly form.)

And a database is for "structured, queryable data". Whereas a log file can be used for that, one in which other apps are dumping non- structured data is just going to pollute the issue.

Not sure if you've ever used ASL, Tim. It has an honest-to-god structured data store, not a text file. And there are APIs to query it. It does echo a textual message to system.log, as a side effect, for backwards compatibility.


How about you read the man page for asl(3) before we resume this fun discussion?

—Jens_______________________________________________

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: Hans van der Meer <email@hidden>
References: 
 >Logging Mechanisms in Cocoa (From: JanakiRam <email@hidden>)
 >Re: Logging Mechanisms in Cocoa (From: Nir Soffer <email@hidden>)
 >Re: Logging Mechanisms in Cocoa (From: "Clint Shryock" <email@hidden>)
 >Re: Logging Mechanisms in Cocoa (From: Timothy Reaves <email@hidden>)
 >Re: Logging Mechanisms in Cocoa (From: Jens Alfke <email@hidden>)
 >Re: Logging Mechanisms in Cocoa (From: Timothy Reaves <email@hidden>)

  • Prev by Date: Re: NSCollectionView Subclass difficulties
  • Next by Date: Re: Xcode 3.0, is it missing the Close Project menu item?
  • Previous by thread: Re: Logging Mechanisms in Cocoa
  • Next by thread: Re: Logging Mechanisms in Cocoa
  • Index(es):
    • Date
    • Thread