Updating ITFoundation to include updates spurred by Haven development.
[ITFoundation.git] / ITDebug.m
1 #import "ITDebug.h"
2
3 NSString *ITDebugErrorPrefixForObject(id object) {
4         return [NSString stringWithFormat:@"[ERROR] %@(0x%x):", NSStringFromClass([object class]), object];
5 }
6
7 static BOOL _ITDebugMode = NO;
8
9 BOOL ITDebugMode() {
10         return _ITDebugMode;
11 }
12
13 void SetITDebugMode(BOOL mode) {
14         _ITDebugMode = mode;
15 }
16
17 void ITDebugLog(NSString *format, ...) {
18         if ( ( _ITDebugMode == YES ) ) {
19                 va_list ap;
20                 va_start (ap, format);
21                 NSLogv (format, ap);
22                 va_end (ap);
23         }
24 }