What's the best way to log an NSError?

- (void)checkThing:(Thing *)thing withError:(NSError *)error {
    NSLog(@"Error: %@", error);
}

Gives me a null message


Solution 1:

Looking at the NSError documentation tells me that you'll need to do something like:

NSLog(@"%@",[error localizedDescription]);

This should then give you human readable output

Solution 2:

NSLog(@"Error: %@", error);

Gives me a null message

Then error is nil, not an NSError instance.