Image credit: loufi
Logging has always bugged me. It's the main way to see what's going on with your code.
You can't add breakpoints everywhere and go around inspecting state--you'll never get anything done. Logging allows you to see what's going on in your program while still being able to interact with it fluidly.
I've never found Logging to work too well on team projects. Everyone adds the log entries that they think are valuable. The entries that will help you understand the behavior of your program. However, the things I want to know are rarely the same as the things they wanted to know when they added those log entries.
You can make your entries louder to make them stick out:
\n\n!!!! Something happened! !!!!\n\n\n
One disadvantage of this is that you can't see more than a few of those on the screen at once. But perhaps more importantly, you lose the feeling that you really understand everything that's going on with your app. And if the existing logging is really verbose, even that level of loudness may not be enough.
ISOLogger provides a solution
ISOLogger is a super simple tool for OS X and iOS apps that makes it easy to see just the logs that matter to you. It takes all the existing log entries and sends them to a file. If you need to see them, open the file. After adding ISOLogger to your project, put this statement in
Run your app, and you'll see the Xcode console is strangely blank, except for a pointer to the redirected file. I say strangely, because you're probably not used to having this blank canvas ready to express your own observations about your program's behavior.
Then when you want to log something, just do so like this:
ISOLog(@"Something happened: %@", message);
That's about all there is to it.
One more thing
Sometimes, despite this newly blank slate, you can fill it up quickly. Then you find yourself poring over the logs, trying to see "Did it happen?" In this case, you may want to resort back to newlines and explanation points. Luckily ISOLog makes this easy too:
ISOLogLoud(@"Didn't expect name to be nil!");
Hope you find this tool useful. It's simple, but it came about because of a need that I had. And I hope it helps solve that need for you as well.
Any and all feedback / suggestions / ideas are greatly appreciated.
Manhattan mobile software engineer.