Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Fetching contributors…
Cannot retrieve contributors at this time
31 lines (26 sloc) 916 Bytes
* 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.