Re: Logging Mechanisms in Cocoa
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