Re: XCode 5 - Logging
Re: XCode 5 - Logging
- Subject: Re: XCode 5 - Logging
- From: Cody Garvin <email@hidden>
- Date: Fri, 01 Aug 2014 08:39:15 -0700
Sorry, I meant CFShow (I had literally just woken up and this was the first email I read today). The link to CFShow should have been linked via the second link.
CFShowPrints a description of a Core Foundation object to stderr. void CFShow (
CFTypeRef obj
);
Parameters- obj
A Core Foundation object derived from CFType. If obj is not a Core Foundation object, an assertion is raised.
DiscussionThe output is printed to the standard I/O standard error (stderr). This function is useful as a debugging aid for Core Foundation objects. Because these objects are based on opaque types, it is difficult to examine their contents directly. However, the opaque types implement description function callbacks that return descriptions of their objects. This function invokes these callbacks.
- Cody
On Aug 1, 2014, at 8:32 AM, Jens Alfke < email@hidden> wrote:
On Aug 1, 2014, at 6:55 AM, Cody Garvin < email@hidden> wrote:
Within logMessage: I figure out which format to use, then display accordingly. Instead of using NSLog, use CFLog(). You’ll need to bridge the string built: CFLog((__bridge CFStringRef)yourMessageString);
There’s no CFLog function declared anywhere I can find. (I dimly recall it being a private API?)
Are you thinking of CFShow? That’s a debugging function that simply writes an object’s description to stderr. For logging, it’s easier just to call fprintf and get more formatting flexibility. The drawback of writing to stderr is that, unlike NSLog, the output doesn’t go into the system logging API (ASL) so it won’t show up in Console.app or in an iOS device’s archived logs.
I’m pressing you for details because I’d really like there to be a CF or Foundation level logging function with more flexibility than NSLog; I just haven’t been able to find one. This document should help.
Neither of those mention a CFLog function either.
—Jens
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden