• 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
CFShow truncated CFStrings in Leopard's Console.app (but not Xcode's debugger console)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

CFShow truncated CFStrings in Leopard's Console.app (but not Xcode's debugger console)


  • Subject: CFShow truncated CFStrings in Leopard's Console.app (but not Xcode's debugger console)
  • From: Nick Beadman <email@hidden>
  • Date: Thu, 2 Apr 2009 11:00:29 -0700

In debug versions of my plug-ins [1] and applications I use a common logging architecture that eventually ends up calling CFShow to log interesting things to the console:

static const char* sPrefix = nil;

void XLogOutput(const char *buffer)
{
CFStringRef lCFString = nil;

if (nil == sPrefix)
{
lCFString = CFStringCreateWithCString(kCFAllocatorDefault, buffer, GetApplicationTextEncoding());
}
else
{
lCFString = CFStringCreateWithFormat(kCFAllocatorDefault, NULL, CFSTR("%s>>> %s"), sPrefix, buffer);
}

if (nil != lCFString)
{
CFShow(lCFString);
CFRelease(lCFString);
}
}


very simple and it works great when using Xcode's console. However, if Xcode is not running these messages end up in the Console and sometimes are truncated. It doesn't matter whether the sPrefix is set above so I am pretty sure it is CFShow that is the culprit. At the moment I am working on a Contextual Menu Item inside of Safari and Console shows:

2/4/09 10:46:48 am [0x0-0x58058].com.apple.Safari[2799] Debug: 'kURLParsingDetailDebug; Unix -> MacUTF8 - raw path segment [2]: "Shared", size: 6', File: StWebNativeURL.cp, Function: ConvertUnixPathToMacUTF8, Line: 1140

(one line-> excellent) followed by:

2/4/09 10:46:48 am [0x0-0x58058].com.apple.Safari[2799] Deb
2/4/09 10:46:48 am [0x0-0x58058].com.apple.Safari[2799] ug: 'kURLParsingDetailDebug; Unix ->
2/4/09 10:46:48 am [0x0-0x58058].com.apple.Safari[2799] MacUTF8 - [Native] "Shared" -> UTF-8', File: StWebNativeURL.cp, Function: ConvertUnixPathToMacUTF8, Line: 1161


(three lines, not so good).

Anyone know why Console is splitting these lines up? This is not a problem on Tiger, only Leopard. I cannot seem to figure out what triggers the problem but it makes it very difficult to get a console log processed from a customer into a useful form.

Thanks,
Nick

--
Nick Beadman
email@hidden
(sent from my mailing list account, email@hidden)

_______________________________________________
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


  • Follow-Ups:
    • Re: CFShow truncated CFStrings in Leopard's Console.app (but not Xcode's debugger console)
      • From: Peter N Lewis <email@hidden>
  • Prev by Date: Re: debugging symbols for universial binary library
  • Next by Date: Re: Why DYLD_INSERT_LIBRARIES works differently on 10.4 and 10.5
  • Previous by thread: Organizer actions don't put output in new document?
  • Next by thread: Re: CFShow truncated CFStrings in Leopard's Console.app (but not Xcode's debugger console)
  • Index(es):
    • Date
    • Thread