Logging to Console


#1

I'm trying to figure out how to log to OS X console from within my app.   if I include <Foundation/Foundation.h> so I can use NSLog(), i get a whole slew of errors in NSObjCRuntime.  Is there a class in Juce that gets around having to use NSLog()?  

Logger::outputDebugString() just writes to Xcode's output window.   


#2

I thought NSLog just wrote to the console too (?)

Do you perhaps just need to use standard c++ and write to cerr or cout?


#3

std::cout writes to the XCode output window.  NSLog writes to the Console.app logs.   but i can't use any of the NS functions if I am using JUCE.  including <Foundation/Foundation.h> causes a ton of errors in NSObjCRuntime because of conflicts with Juce headers, so that's why i am asking for another means to write to Console.app's "All Messages" log. 


#4

Sounds like you might need a buffer class with a header that does not include the JUCE header, and any JUCE classes be given the return and parameter types of void* 

Then your implementation can include the JUCE headers. 

This is a really good article that helped me solve these issues: 

http://philjordan.eu/article/mixing-objective-c-c++-and-objective-c++


#5

link is dead. 

 

Thankfully, there is Google's Cached version


#6

I've copied, pasted and formatted the article as it was really useful in helping me understand how to bridge between Objective-C and C++ and get things working in my project. 

http://www.juce.com/forum/topic/mixing-objective-c-c-and-objective-c-copied-article