All posts

Simple log for iOS

1 min read

In every method two very important variables can be found. One is already known by many iOS dev, and it is 'self'. The other one is '_cmd'. This last one is the selector of the current method. This variable can useful for logging purposes. In the Silver Sparrow log framework, it is used inside a macro in order to add important information to a log entry. For example: NSLog(@"{ERROR} [%@ %@] %@", NSStringFromClass([self class]), NSStringFromSelector(_cmd), message); In this line, the class name and the method name are added to NSLog. You can download and use the log library, which is available at SSLoger on GitHub

More posts