Sunday, 8 September 2013

What will be the difference between NSLog and Cout

What will be the difference between NSLog and Cout

I have a cocoa application core library is C++ which cocoa app uses. I
need to put logs in both parts of the app so that I can easily diagnose
the issues when the logs are reported from users via crash log reporter (a
separate component).
The cocoa part of the app the logs are like
NSLog(@"something..");
In the C++ library which is a separate project in C++ (not .mm but .h and
.cpp) I would like to have similar logs. so if I do
cout<<"log from C++";
I don't seem to get the logs in the crash log reporter (an objective C
component) if the program crashes. It only seem to be able to report logs
from the objective C. I do however see the log messages from C++ on the
output screen but it does not seem to do the job of writing the same to
the file as well so that if the program crashes the logs are there to be
reported.
So what is the best way to consistently write logs which are also
reportable if the program crashes. Given the program is cocoa and uses
separate C++ components.
Thanks,

No comments:

Post a Comment