forked from fjolnir/DatabaseKit
-
Notifications
You must be signed in to change notification settings - Fork 1
/
ActiveRecord_Prefix.pch
25 lines (21 loc) · 1.49 KB
/
ActiveRecord_Prefix.pch
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
//
// Prefix header for all source files of the 'ActiveRecord' target in the 'ActiveRecord' project.
//
#ifdef __OBJC__
#import <Foundation/Foundation.h>
// Some debug stuff
// Crashesss
#define CrashHerePlease() { *(int *)0 = 123; }
#define ARLog(...) printf("%s(Active Record)[%u] %32.32s: %s\n", [[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleName"] UTF8String], \
getpid(),\
[[NSString stringWithFormat:@"%s:%u", [[[NSString stringWithUTF8String:__FILE__] lastPathComponent] UTF8String], __LINE__] UTF8String],\
[[NSString stringWithFormat:__VA_ARGS__] UTF8String])
/*#define ARLog(...) printf("%s: %s\n", [[NSString stringWithFormat:@"%s:%u", [[[NSString stringWithUTF8String:__FILE__] lastPathComponent] UTF8String], __LINE__] UTF8String],\
[[NSString stringWithFormat:__VA_ARGS__] UTF8String])*/
#ifdef ENABLE_AR_DEBUG
// We make it a warning because when unit testing it's nice to see the logs in the list view instead of having to scroll through all the compiler output
#define ARDebugLog(...) printf("%s: warning: %s\n", [[NSString stringWithFormat:@"%s:%u", [[[NSString stringWithUTF8String:__FILE__] lastPathComponent] UTF8String], __LINE__] UTF8String], [[NSString stringWithFormat:__VA_ARGS__] UTF8String])
#else
# define ARDebugLog(...)
#endif
#endif