[iOS] 로그(NSLog) 기록
iOS2011. 1. 17. 18:35
Ex) NSLog("Hello. %s", Name);
편리한 스트링 메크로
__FUNCTION__
__LINE__
__FILE__
#ifdef DEBUG
# define DLog(fmt, ...) NSLog((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__);
#else
# define DLog(...)
#endif
// ALog always displays output regardless of the DEBUG setting
#define ALog(fmt, ...) NSLog((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__);
The DLog macro is used to only output when the DEBUG variable is set (-DDEBUG in the projects's C flags for the debug confirguration).
ALog will always output text (like the regular NSLog).
The output (e.g. ALog(@"Hello world") ) will look like this:
-[LibraryController awakeFromNib] [Line 364] Hello world
'iOS' 카테고리의 다른 글
[iOS] 이미지 리사이즈 (Image Resize) (0) | 2011.07.01 |
---|---|
[iOS] UIImagePickerController로 Photo Library에서 사진 선택하기 (0) | 2011.07.01 |
[iOS] 이미지 합치기(Image Merge) (0) | 2011.07.01 |
[iOS] NSString Encoding (0) | 2011.07.01 |
[iOS] NSString(문자열) 클래스 이름으로 부터 해당 클래스 객체 생성하기 (0) | 2011.03.09 |
[아이폰] "누구니?" 두둥! 최초 유료어플 등록 (0) | 2010.04.16 |
[아이폰] 깊은 뮤터블 복사(mutableCopy) (5) | 2010.01.27 |
iPod touch인지 iPhone 인지 구분하기 (0) | 2010.01.22 |
[아이폰] 인터넷 연결 확인 (0) | 2010.01.22 |
날짜(NSDate)를 원하는 포멧의 문자형태(NSString)로 받기 (0) | 2010.01.22 |