Skip to content

Commit

Permalink
Move PLLog() into debug.h
Browse files Browse the repository at this point in the history
  • Loading branch information
DHowett committed Feb 20, 2013
1 parent 1de28f1 commit 9f91812
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 10 deletions.
7 changes: 2 additions & 5 deletions Tweak.xm
Expand Up @@ -3,11 +3,8 @@

#import "prefs.h"

#if DEBUG
# define PLLog(...) NSLog(@"PreferenceLoader! %s:%d: %@", __FILE__, __LINE__, [NSString stringWithFormat:__VA_ARGS__])
#else
# define PLLog(...)
#endif
#define DEBUG_TAG "PreferenceLoader"
#import "debug.h"

/* {{{ Imports (Preferences.framework) */
// Weak (3.2+, dlsym)
Expand Down
14 changes: 14 additions & 0 deletions debug.h
@@ -0,0 +1,14 @@
#ifndef __DEBUG_H
#define __DEBUG_H

#ifndef DEBUG_TAG
#define DEBUG_TAG "PreferenceLoader"
#endif

#if DEBUG
# define PLLog(...) NSLog(@ DEBUG_TAG "! %s:%d: %@", __FILE__, __LINE__, [NSString stringWithFormat:__VA_ARGS__])
#else
# define PLLog(...)
#endif

#endif
7 changes: 2 additions & 5 deletions prefs.xm
Expand Up @@ -6,11 +6,8 @@

#import "prefs.h"

#if DEBUG
# define PLLog(...) NSLog(@"libprefs! %s:%d: %@", __FILE__, __LINE__, [NSString stringWithFormat:__VA_ARGS__])
#else
# define PLLog(...)
#endif
#define DEBUG_TAG "libprefs"
#import "debug.h"

/* {{{ Imports (Preferences.framework) */
extern "C" NSArray* SpecifiersFromPlist(NSDictionary* plist,
Expand Down

0 comments on commit 9f91812

Please sign in to comment.