Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

31 lines (26 sloc) 0.916 kb
/*
* DebugLog.m
* DebugLog
*
* Created by Karl Kraft on 3/22/09.
* Copyright 2009 Karl Kraft. All rights reserved.
*
*/
#include "DebugLog.h"
void _DebugLog(const char *file, int lineNumber, const char *funcName, NSString *format,...) {
va_list ap;
va_start (ap, format);
if (![format hasSuffix: @"\n"]) {
format = [format stringByAppendingString: @"\n"];
}
NSString *body = [[NSString alloc] initWithFormat: format arguments: ap];
va_end (ap);
const char *threadName = [[[NSThread currentThread] name] UTF8String];
NSString *fileName=[[NSString stringWithUTF8String:file] lastPathComponent];
if (threadName) {
fprintf(stderr,"%s/%s (%s:%d) \n\t\t%s",threadName,funcName,[fileName UTF8String],lineNumber,[body UTF8String]);
} else {
fprintf(stderr,"%p/%s (%s:%d) \n\t\t%s",[NSThread currentThread],funcName,[fileName UTF8String],lineNumber,[body UTF8String]);
}
[body release];
}
Jump to Line
Something went wrong with that request. Please try again.