• 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: XCode 5 - Logging
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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. 

CFShow

Prints 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. 
Discussion
The 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.
https://developer.apple.com/library/ios/qa/qa1669/_index.html
https://developer.apple.com/library/ios/documentation/corefoundation/Reference/CFTypeRef/Reference/reference.html#//apple_ref/doc/uid/20001203-CH201-F11096

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

References: 
 >XCode 5 - Logging (From: Dave <email@hidden>)
 >Re: XCode 5 - Logging (From: Cody Garvin <email@hidden>)
 >Re: XCode 5 - Logging (From: Jens Alfke <email@hidden>)

  • Prev by Date: Re: XCode 5 - Logging
  • Next by Date: Re: XCode 5 - Logging
  • Previous by thread: Re: XCode 5 - Logging
  • Next by thread: Re: XCode 5 - Logging
  • Index(es):
    • Date
    • Thread