Logs an error message to the Apple System Log facility.
The message consists of a timestamp and the process ID prefixed to the string you pass in. You compose this string with a format string and one or more arguments to be inserted into the string. The format specification allowed by this function is that which is understood by NSString’s formatting capabilities.
Displaying log messages in the system console while running your application is one of the oldest debugging mechanisms available. Using logging, you can generate a transcript describing the operations being performed by your application that you can review long after your application has finished running. Also, while your application is running, you can observe log messages being generated and written to the console as the events in your app they describe are taking place. As a developer, you are in complete control of the text and information displayed in the console by NSLog. Logging can reveal even the toughest to find problems in an app.
Here is an example of what a call to NSLog looks like:
NSString *message = @"test message";
NSLog( @"Here is a test message: '%@'", message );
Console:
Here is a test message: 'test message'
Reference:
Basic debugging with the NSLog function and the DEBUG preprocessor macro