Hi there! So it’s the future now (2018 to be precise) and the recommendations in this post aren’t valid anymore. I’d recommend you have a look at CocoaLumberjack instead of using the code here in anything you’re working on.
Have you ever found yourself needing to have your application record quite a bit of data? Think pushing it to the user’s console is messy? (it is!) Here’s your answer. In the
main.m of your cocoa application, simply add the following imports:
Then make your “main” method look like this:
Now, all of your logging messages will be pushed to a log file with the same name as your application under