Notice
Recent Posts
Recent Comments
Link
250x250
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | ||||
| 4 | 5 | 6 | 7 | 8 | 9 | 10 |
| 11 | 12 | 13 | 14 | 15 | 16 | 17 |
| 18 | 19 | 20 | 21 | 22 | 23 | 24 |
| 25 | 26 | 27 | 28 | 29 | 30 | 31 |
Tags
- pypdf2
- ironpython
- YOLOv7
- Text-to-Speech
- pdf merge
- computervision
- DeepLearning
- Text To Speech
- 업무자동화
- objectdetection
- pythonnet
- YOLOv5
- Google API
- 파이썬 #업무자동화 #python
- 사무자동화 #Selenium
- 사무자동화
- pyautogui
- google cloud
- yolo
- processstart
Archives
- Today
- Total
Doarchive
[Objective C] iOS에서 log 를 txt 파일로 저장하는 두 가지 방법 본문
728x90
- (void)redirectDLogToDocumentFolder{
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentDirectory = [paths objectAtIndex:0];
NSString *fileName = [NSString stringWithFormat:@"Fwupdate.log"];
NSString *logFilePath = [documentDirectory stringByAppendingPathComponent:fileName];
NSFileManager *defaultManager = [NSFileManager defaultManager];
[defaultManager removeItemAtPath:logFilePath error:nil];
freopen([logFilePath cStringUsingEncoding:NSASCIIStringEncoding], "a+", stdout);
freopen([logFilePath cStringUsingEncoding:NSASCIIStringEncoding], "a+", stderr);
}
static dispatch_once_t pred = 0;
dispatch_once(&pred,^{
[UIApplication redirectConsoleLogToDocumentFolder:@"rfid_log.txt"];
});
- (void) redirectConsoleLogToDocumentFolder:(NSString*)filename
{
NSArray *paths
= NSSearchPathForDirectoriesInDomains
(NSDocumentDirectory,
NSUserDomainMask, YES);
NSString *documentsDirectory
= [paths objectAtIndex:0];
NSString *logPath
= [documentsDirectory stringByAppendingPathComponent:filename];
freopen([logPath cStringUsingEncoding:NSASCIIStringEncoding], "w",stderr);
}728x90
'Mobile > iOS' 카테고리의 다른 글
| [Xcode] IPA 파일 만들기 (0) | 2020.03.25 |
|---|---|
| [Xcode] Run 을 해도 실행이 안될때 (0) | 2020.03.24 |
| XCode 단축키 (0) | 2020.03.18 |
| iOS 에서 라이브러리와 프레임워크 의 차이 (0) | 2020.03.13 |
| [iOS] Xcode Framework 파일 만들기 (0) | 2020.03.13 |