36#ifndef OOLOG_POISON_NSLOG
37 #define OOLOG_POISON_NSLOG 0
41#ifndef OOLOG_FUNCTION_NAME
42 #if defined (__GNUC__) && __GNUC__ >= 2
43 #define OOLOG_FUNCTION_NAME __FUNCTION__
44 #elif 199901L <= __STDC_VERSION__
45 #define OOLOG_FUNCTION_NAME __func__
47 #define OOLOG_FUNCTION_NAME NULL
51#ifndef OOLOG_FILE_NAME
52 #ifdef OOLOG_NO_FILE_NAME
53 #define OOLOG_FILE_NAME NULL
55 #define OOLOG_FILE_NAME __FILE__
65#ifndef OOLOG_SHORT_CIRCUIT
66 #define OOLOG_SHORT_CIRCUIT 1
87#if OOLOG_SHORT_CIRCUIT
88 #define OOLog(class, format, ...) do { if (OOLogWillDisplayMessagesInClass(class)) { OOLogWithFunctionFileAndLine(class, OOLOG_FUNCTION_NAME, OOLOG_FILE_NAME, __LINE__, format, ## __VA_ARGS__); }} while (0)
89 #define OOLogWithArguments(class, format, args) do { if (OOLogWillDisplayMessagesInClass(class)) { OOLogWithFunctionFileAndLineAndArguments(class, OOLOG_FUNCTION_NAME, OOLOG_FILE_NAME, __LINE__, format, args); }} while (0)
91 #define OOLog(class, format, ...) OOLogWithFunctionFileAndLine(class, OOLOG_FUNCTION_NAME, OOLOG_FILE_NAME, __LINE__, format, ## __VA_ARGS__)
92 #define OOLogWithArguments(class, format, args) OOLogWithFunctionFileAndLineAndArguments(class, OOLOG_FUNCTION_NAME, OOLOG_FILE_NAME, __LINE__, format, args)
100#if OOLOG_SHORT_CIRCUIT
101#define OOLogIndentIf(class) do { if (OOLogWillDisplayMessagesInClass(class)) OOLogIndent(); } while (0)
102#define OOLogOutdentIf(class) do { if (OOLogWillDisplayMessagesInClass(class)) OOLogOutdent(); } while (0)
109#define OOLOG_ERROR_PREFIX @"***** ERROR: "
110#define OOLOG_WARNING_PREFIX @"----- WARNING: "
112#define OOLogERR(class, format, ...) OOLogWithPrefix(class, OOLOG_FUNCTION_NAME, OOLOG_FILE_NAME, __LINE__, OOLOG_ERROR_PREFIX ,format, ## __VA_ARGS__)
113#define OOLogWARN(class, format, ...) OOLogWithPrefix(class, OOLOG_FUNCTION_NAME, OOLOG_FILE_NAME, __LINE__, OOLOG_WARNING_PREFIX, format, ## __VA_ARGS__)
125#define OOLogGenericParameterError() OOLogGenericParameterErrorForFunction(OOLOG_FUNCTION_NAME)
129#define OOLogGenericSubclassResponsibility() OOLogGenericSubclassResponsibilityForFunction(OOLOG_FUNCTION_NAME)
133#if OOLOG_POISON_NSLOG
134 #pragma GCC poison NSLog
135#elif !OOLOG_NO_HIJACK_NSLOG
137 #define NSLog(format, ...) OOLog(kOOLogUnconvertedNSLog, format, ## __VA_ARGS__)
138 #define NSLogv(format, args) OOLogWithArguments(kOOLogUnconvertedNSLog, format, args)
144#define OODebugLog OOLog
146#define OODebugLog(class, format, ...) do { (void)class; if (0) (void)format; } while (0)
152#define OOExtraLog OOLog
154#define OOExtraLog(class, format, ...) do { (void)class; if (0) (void)format; } while (0)
#define OO_TAKES_FORMAT_STRING(stringIndex, firstToCheck)
void OOLogPushIndent(void)
NSString *const kOOLogException
NSString *const kOOLogOpenGLError
NSString *const kOOLogInconsistentState
NSString *const kOOLogDeprecatedMethod
void OOLogPopIndent(void)
void void void OOLogWithFunctionFileAndLineAndArguments(NSString *inMessageClass, const char *inFunction, const char *inFile, unsigned long inLine, NSString *inFormat, va_list inArguments) OO_TAKES_FORMAT_STRING(5
BOOL OOLogWillDisplayMessagesInClass(NSString *inMessageClass)
#define OOLogOutdentIf(class)
NSString *const kOOLogFileNotLoaded
void OOLogGenericSubclassResponsibilityForFunction(const char *inFunction)
void OOLogWithPrefix(NSString *inMessageClass, const char *inFunction, const char *inFile, unsigned long inLine, NSString *inPrefix, NSString *inFormat,...) OO_TAKES_FORMAT_STRING(6
NSString *const kOOLogAllocationFailure
NSString *const kOOLogParameterError
NSString *const kOOLogUnconvertedNSLog
NSString *const kOOLogFileNotFound
#define OOLogIndentIf(class)
NSString *const kOOLogSubclassResponsibility
void void OOLogWithFunctionFileAndLine(NSString *inMessageClass, const char *inFunction, const char *inFile, unsigned long inLine, NSString *inFormat,...) OO_TAKES_FORMAT_STRING(5
void OOLogGenericParameterErrorForFunction(const char *inFunction)