• 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: Mon, 11 Feb 2008 08:06:24 -0800


On 11 Feb '08, at 12:53 AM, Hans van der Meer wrote:

asl_log(NULL, NULL, 1, "TESTING ASL-LOG:%s", "asl-log test");

but I do not see anything resulting from it. Neither in the XCode console, nor in the Console app. Why not? I suppose I am doing something wrong, but what?

Nothing should show up in the Xcode console, because ASL doesn't write to stderr. It would be nice if Xcode intercepted ASL output from tasks it runs and echoed it to its console; maybe someday. I got around this in my code by having my own logging macros that write to stderr instead of asl if stderr looks like it points to a TTY. (Sadly, I don't have that tricky code snippet anymore. I think I swiped most of it from the innards of NSLog.)


Where in Console.app did you look? Show the log list (via the View menu) and select "All Messages" (the first item in the list). You should see it there.

If you want to make a view in Console that will show only your app's messages, you can use "New Log Database Query..." and fill out the form. The most useful things to filter on are Sender (process name) or Facility (user-defined string you pass into asl_log.) Facility is useful if your code may run in multiple apps.

—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


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>)
 >Re: Logging Mechanisms in Cocoa (From: Jens Alfke <email@hidden>)
 >Re: Logging Mechanisms in Cocoa (From: Hans van der Meer <email@hidden>)

  • Prev by Date: Re: Loading saved file into NSArrayController
  • Next by Date: Re: self = [super init] debate.
  • Previous by thread: Re: Logging Mechanisms in Cocoa
  • Next by thread: My app breaks when moved while running
  • Index(es):
    • Date
    • Thread