Posted By

BenClayton on 01/20/10


Tagged

logging NSLog iphone


Versions (?)

Who likes this?

5 people have marked this snippet as a favorite

Leech
clearbrian
wpellis
Tintenklecks
cnathan


NSLog log function name, file name and line number


 / Published in: Objective C
 

  1. NSLog(@”[%s:%s:%d] Here i am”,__FUNCTION__,__FILE__,__LINE__);

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: clearbrian on June 30, 2010

Beware cut and pasting this. The quotes are the ones they use in docs not the one over the number 8 on the mac keyboard. You may need to paste then delete and replace each quote with the one from the number 8 key NSLog(@"[%s:%s:%d] Here i am", FUNCTION,FILE,LINE);

You need to login to post a comment.