mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-25 09:41:15 +00:00
Merge pull request #188 from iamleeg/patch-1
Reword NSDebug*LLog "level" argument to "key"
This commit is contained in:
commit
b9d54cf426
1 changed files with 23 additions and 23 deletions
|
@ -63,7 +63,7 @@ GS_EXPORT NSString* GSDebugMethodMsg(id obj, SEL sel, const char *file,
|
||||||
/**
|
/**
|
||||||
<p>NSDebugLLog() is the basic debug logging macro used to display
|
<p>NSDebugLLog() is the basic debug logging macro used to display
|
||||||
log messages using NSLog(), if debug logging was enabled at compile
|
log messages using NSLog(), if debug logging was enabled at compile
|
||||||
time and the appropriate logging level was set at runtime.
|
time and the appropriate logging key was set at runtime.
|
||||||
</p>
|
</p>
|
||||||
<p>Debug logging which can be enabled/disabled by defining GSDIAGNOSE
|
<p>Debug logging which can be enabled/disabled by defining GSDIAGNOSE
|
||||||
when compiling and also setting values in the mutable set which
|
when compiling and also setting values in the mutable set which
|
||||||
|
@ -71,7 +71,7 @@ GS_EXPORT NSString* GSDebugMethodMsg(id obj, SEL sel, const char *file,
|
||||||
unless diagnose=no is specified in the make arguments.
|
unless diagnose=no is specified in the make arguments.
|
||||||
</p>
|
</p>
|
||||||
<p>NSProcess initialises a set of strings that are the names of active
|
<p>NSProcess initialises a set of strings that are the names of active
|
||||||
debug levels using the '--GNU-Debug=...' command line argument.
|
debug keys using the '--GNU-Debug=...' command line argument.
|
||||||
Each command-line argument of that form is removed from
|
Each command-line argument of that form is removed from
|
||||||
<code>NSProcessInfo</code>'s list of arguments and the variable part
|
<code>NSProcessInfo</code>'s list of arguments and the variable part
|
||||||
(...) is added to the set.
|
(...) is added to the set.
|
||||||
|
@ -83,23 +83,23 @@ GS_EXPORT NSString* GSDebugMethodMsg(id obj, SEL sel, const char *file,
|
||||||
You can of course supply multiple '--GNU-Debug=...' arguments to
|
You can of course supply multiple '--GNU-Debug=...' arguments to
|
||||||
output debug information on more than one thing.
|
output debug information on more than one thing.
|
||||||
</p>
|
</p>
|
||||||
<p>NSUserDefaults also adds debug levels from the array given by the
|
<p>NSUserDefaults also adds debug keys from the array given by the
|
||||||
GNU-Debug key ... but these values will not take effect until the
|
GNU-Debug default ... but these values will not take effect until the
|
||||||
+standardUserDefaults method is called ... so they are useless for
|
+standardUserDefaults method is called ... so they are useless for
|
||||||
debugging NSUserDefaults itself or for debugging any code executed
|
debugging NSUserDefaults itself or for debugging any code executed
|
||||||
before the defaults system is used.
|
before the defaults system is used.
|
||||||
</p>
|
</p>
|
||||||
<p>To embed debug logging in your code you use the NSDebugLLog() or
|
<p>To embed debug logging in your code you use the NSDebugLLog() or
|
||||||
NSDebugLog() macro. NSDebugLog() is just NSDebugLLog() with the debug
|
NSDebugLog() macro. NSDebugLog() is just NSDebugLLog() with the debug
|
||||||
level set to 'dflt'. So, to activate debug statements that use
|
key set to 'dflt'. So, to activate debug statements that use
|
||||||
NSDebugLog(), you supply the '--GNU-Debug=dflt' argument to your program.
|
NSDebugLog(), you supply the '--GNU-Debug=dflt' argument to your program.
|
||||||
</p>
|
</p>
|
||||||
<p>You can also change the active debug levels under your programs control -
|
<p>You can also change the active debug keys under your programs control -
|
||||||
NSProcessInfo has a [-debugSet] method that returns the mutable set that
|
NSProcessInfo has a [-debugSet] method that returns the mutable set that
|
||||||
contains the active debug levels - your program can modify this set.
|
contains the active debug keys - your program can modify this set.
|
||||||
</p>
|
</p>
|
||||||
<p>Two debug levels have a special effect - 'dflt' is the level used for
|
<p>Two debug keys have a special effect - 'dflt' is the key used for
|
||||||
debug logs statements where no debug level is specified, and 'NoWarn'
|
debug logs statements where no debug key is specified, and 'NoWarn'
|
||||||
is used to *disable* warning messages.
|
is used to *disable* warning messages.
|
||||||
</p>
|
</p>
|
||||||
<p>As a convenience, there are four more logging macros you can use -
|
<p>As a convenience, there are four more logging macros you can use -
|
||||||
|
@ -109,13 +109,13 @@ GS_EXPORT NSString* GSDebugMethodMsg(id obj, SEL sel, const char *file,
|
||||||
and either function or class/method in which the message was generated.
|
and either function or class/method in which the message was generated.
|
||||||
</p>
|
</p>
|
||||||
*/
|
*/
|
||||||
#define NSDebugLLog(level, format, args...) \
|
#define NSDebugLLog(key, format, args...) \
|
||||||
do { if (GSDebugSet(level) == YES) \
|
do { if (GSDebugSet(key) == YES) \
|
||||||
NSLog(format , ## args); } while (0)
|
NSLog(format , ## args); } while (0)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This macro is a shorthand for NSDebugLLog() using then default debug
|
* This macro is a shorthand for NSDebugLLog() using the default debug
|
||||||
* level ... 'dflt'
|
* key ... 'dflt'
|
||||||
*/
|
*/
|
||||||
#define NSDebugLog(format, args...) \
|
#define NSDebugLog(format, args...) \
|
||||||
do { if (GSDebugSet(@"dflt") == YES) \
|
do { if (GSDebugSet(@"dflt") == YES) \
|
||||||
|
@ -125,16 +125,16 @@ GS_EXPORT NSString* GSDebugMethodMsg(id obj, SEL sel, const char *file,
|
||||||
* This macro is like NSDebugLLog() but includes the name and location
|
* This macro is like NSDebugLLog() but includes the name and location
|
||||||
* of the function in which the macro is used as part of the log output.
|
* of the function in which the macro is used as part of the log output.
|
||||||
*/
|
*/
|
||||||
#define NSDebugFLLog(level, format, args...) \
|
#define NSDebugFLLog(key, format, args...) \
|
||||||
do { if (GSDebugSet(level) == YES) { \
|
do { if (GSDebugSet(key) == YES) { \
|
||||||
NSString *s = GSDebugFunctionMsg( \
|
NSString *s = GSDebugFunctionMsg( \
|
||||||
__PRETTY_FUNCTION__, __FILE__, __LINE__, \
|
__PRETTY_FUNCTION__, __FILE__, __LINE__, \
|
||||||
[NSString stringWithFormat: format, ##args]); \
|
[NSString stringWithFormat: format, ##args]); \
|
||||||
NSLog(@"%@", s); }} while (0)
|
NSLog(@"%@", s); }} while (0)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This macro is a shorthand for NSDebugFLLog() using then default debug
|
* This macro is a shorthand for NSDebugFLLog() using the default debug
|
||||||
* level ... 'dflt'
|
* key ... 'dflt'
|
||||||
*/
|
*/
|
||||||
#define NSDebugFLog(format, args...) \
|
#define NSDebugFLog(format, args...) \
|
||||||
do { if (GSDebugSet(@"dflt") == YES) { \
|
do { if (GSDebugSet(@"dflt") == YES) { \
|
||||||
|
@ -147,8 +147,8 @@ GS_EXPORT NSString* GSDebugMethodMsg(id obj, SEL sel, const char *file,
|
||||||
* This macro is like NSDebugLLog() but includes the name and location
|
* This macro is like NSDebugLLog() but includes the name and location
|
||||||
* of the <em>method</em> in which the macro is used as part of the log output.
|
* of the <em>method</em> in which the macro is used as part of the log output.
|
||||||
*/
|
*/
|
||||||
#define NSDebugMLLog(level, format, args...) \
|
#define NSDebugMLLog(key, format, args...) \
|
||||||
do { if (GSDebugSet(level) == YES) { \
|
do { if (GSDebugSet(key) == YES) { \
|
||||||
NSString *s = GSDebugMethodMsg( \
|
NSString *s = GSDebugMethodMsg( \
|
||||||
self, _cmd, __FILE__, __LINE__, \
|
self, _cmd, __FILE__, __LINE__, \
|
||||||
[NSString stringWithFormat: format, ##args]); \
|
[NSString stringWithFormat: format, ##args]); \
|
||||||
|
@ -156,7 +156,7 @@ GS_EXPORT NSString* GSDebugMethodMsg(id obj, SEL sel, const char *file,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This macro is a shorthand for NSDebugMLLog() using then default debug
|
* This macro is a shorthand for NSDebugMLLog() using then default debug
|
||||||
* level ... 'dflt'
|
* key ... 'dflt'
|
||||||
*/
|
*/
|
||||||
#define NSDebugMLog(format, args...) \
|
#define NSDebugMLog(format, args...) \
|
||||||
do { if (GSDebugSet(@"dflt") == YES) { \
|
do { if (GSDebugSet(@"dflt") == YES) { \
|
||||||
|
@ -188,11 +188,11 @@ GS_EXPORT NSString* GSDebugMethodMsg(id obj, SEL sel, const char *file,
|
||||||
GSDebugAllocationTagRecordedObject(object, tag); } while (0)
|
GSDebugAllocationTagRecordedObject(object, tag); } while (0)
|
||||||
|
|
||||||
#else
|
#else
|
||||||
#define NSDebugLLog(level, format, args...)
|
#define NSDebugLLog(key, format, args...)
|
||||||
#define NSDebugLog(format, args...)
|
#define NSDebugLog(format, args...)
|
||||||
#define NSDebugFLLog(level, format, args...)
|
#define NSDebugFLLog(key, format, args...)
|
||||||
#define NSDebugFLog(format, args...)
|
#define NSDebugFLog(format, args...)
|
||||||
#define NSDebugMLLog(level, format, args...)
|
#define NSDebugMLLog(key, format, args...)
|
||||||
#define NSDebugMLog(format, args...)
|
#define NSDebugMLog(format, args...)
|
||||||
#define NSDebugFRLog(object, msg)
|
#define NSDebugFRLog(object, msg)
|
||||||
#define NSDebugMRLog(object, msg)
|
#define NSDebugMRLog(object, msg)
|
||||||
|
|
Loading…
Reference in a new issue