Miscellaneous improvements.
5 // Created by Jens Alfke on 1/5/08.
6 // Copyright 2008 Jens Alfke. All rights reserved.
9 #import <Cocoa/Cocoa.h>
12 NSString* LOC( NSString *key ); // Localized string lookup
15 #define Log(FMT,ARGS...) do{if(__builtin_expect(_gShouldLog,0)) _Log(FMT,##ARGS);}while(0)
18 void AlwaysLog( NSString *msg, ... ) __attribute__((format(__NSString__, 1, 2)));
20 #define LogTo(DOMAIN,FMT,ARGS...) do{if(__builtin_expect(_gShouldLog,0)) _LogTo(@""#DOMAIN,FMT,##ARGS);}while(0)
22 BOOL _WillLogTo( NSString *domain );
23 BOOL EnableLog( BOOL enable );
24 #define EnableLogTo( DOMAIN, VALUE ) _EnableLogTo(@""#DOMAIN, VALUE)
25 #define WillLogTo( DOMAIN ) _WillLogTo(@""#DOMAIN)
28 // internals; don't use directly
29 extern int _gShouldLog;
30 void _Log( NSString *msg, ... ) __attribute__((format(__NSString__, 1, 2)));
31 void Warn( NSString *msg, ... ) __attribute__((format(__NSString__, 1, 2)));
32 void _LogTo( NSString *domain, NSString *msg, ... ) __attribute__((format(__NSString__, 2, 3)));
33 BOOL _WillLogTo( NSString *domain );
34 BOOL _EnableLogTo( NSString *domain, BOOL enable );