Inflexibility of NSLog

Originator:jens.ayton
Number:rdar://5322007 Date Originated:09-Jul-2007 10:25 AM
Status:Open Resolved:
Product:Mac OS X Product Version:
Classification:Enhancement Reproducible:
 
Summary: 
NSLog() is a useful function, but limited. Applications with more complex logging needs will tend to use custom logging systems. However, system and third-party frameworks generally use NSLog(). Therefore, it would be very useful to be able to intercept NSLog() within an application in order to be able to integrate framework log messages into the aforementioned custom logging systems.

Steps to Reproduce: n/a
Expected Results: n/a
Actual Results: n/a
Regression: This restriction has existed since before OS X.

Notes:
This enhancement request could be fulfilled by exposing the undocumented _NSLogCStringFunction() and the sort-of-documented _NSSetLogCStringFunction() in Foundation.framework. I am currently using these functions (loading them dynamically to guard against their sudden disappearance) but using undocumented functions is of course never a satisfactory solution.

[Comment: see http://jens.ayton.se/blag/hacking-your-log-messages/]

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!