From 11f1a891284bee3994ed5f01a7be39245fa33be6 Mon Sep 17 00:00:00 2001 From: Shazron Abdullah Date: Mon, 18 May 2015 16:01:19 -0700 Subject: [PATCH] Added NSLogOut method. Same signature as NSLog, but logs to stdout instead of stderr. --- ios-deploy.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ios-deploy.c b/ios-deploy.c index d3c84b1..7dac093 100644 --- a/ios-deploy.c +++ b/ios-deploy.c @@ -221,6 +221,15 @@ void on_sys_error(const char* fmt, ...) { va_end(args); } +void NSLogOut(NSString* format, ...) { + va_list valist; + va_start(valist, format); + NSString* str = [[[NSString alloc] initWithFormat:format arguments:valist] autorelease]; + va_end(valist); + + [[str stringByAppendingString:@"\n"] writeToFile:@"/dev/stdout" atomically:NO encoding:NSUTF8StringEncoding error:nil]; +} + Boolean path_exists(CFTypeRef path) { if (CFGetTypeID(path) == CFStringGetTypeID()) { CFURLRef url = CFURLCreateWithFileSystemPath(NULL, path, kCFURLPOSIXPathStyle, true);