Skip to content

Instantly share code, notes, and snippets.

View kasperkronborg's full-sized avatar
🏰
Ask me anything React

Kasper Kronborg kasperkronborg

🏰
Ask me anything React
  • Copenhagen, Denmark
View GitHub Profile
@olegam
olegam / gist:9545390
Last active August 29, 2015 13:57
NSLog tweak to create a clickable link to the file and line that created the log output. Short and concise format to fit on a single line in most cases.

Sometimes it can be hard to figure out where log statements in the console come from. With this tweak you get log output like this:

11:03:12.257 : User logged in with username: olegam (FIBAPIClient.m:507)

Because of AppCode awesomeness the FileName:LineNumber part will be clickable and take you right to the code that produced the log statement. To get this in your own project you should:

  1. Redefine NSLog in your prefix.pch file
#define NSLog(format,...) SHPLogFunction(format, [@""__FILE__ lastPathComponent], __LINE__, ##__VA_ARGS__);