I'm using CocoaLumberjack for all the logging in my app. Using this I can log straight to a file by using DDLogVerbose(...) or any of the available variants.
I'm also using fmdb (SQLite wrapper). The problem is that this library uses NSLog() and none if its output ends up on my log file.
Is there a way to capture NSLog's output and redirect it to CocoaLumberjack's? Or if that's not possible, just "rewrite" NSLog() so that it actually executes DDLogVerbose()?
Try adding
#define NSLog DDLogInfo
to the top of the other libraries. Of course you will need to
#include "Logging.h"
for it to work.
This may work, but it could also create an infinite loop since CocoaLumberjack is using NSLog, so a redefinition with DDLogInfo could mess things up. You just need to try and see.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With