add test logging methods

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/ec/trunk@36379 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2013-03-18 07:42:41 +00:00
parent 80bd3b6a7b
commit 8d65d2eb37
3 changed files with 37 additions and 1 deletions

View file

@ -1,3 +1,9 @@
2013-03-18 Richard Frith-Macdonald <rfm@gnu.org>
* EcProcess.h:
* EcProcess.m:
Add test logging methods ([-ecTestLog:...])
2013-03-15 Richard Frith-Macdonald <rfm@gnu.org>
* EcProcess.h: Document EcCoreSize

View file

@ -846,6 +846,16 @@ extern NSString* cmdVersion(NSString *ver);
*/
- (int) ecRun;
/** Logs a message iff the process is running in test mode
* (that is, when EcTesting is set).
*/
- (void) ecTestLog: (NSString*)fmt arguments: (va_list)args;
/** Logs a message iff the process is running in test mode.<br />
* Operates by calling the -ecTestLog:arguments: method.
*/
- (void) ecTestLog: (NSString*)fmt, ...;
@end
@interface NSObject (RemoteServerDelegate)

View file

@ -2008,7 +2008,7 @@ NSLog(@"Ignored attempt to set timer interval to %g ... using 10.0", interval);
[c setDelegate: self];
[[NSNotificationCenter defaultCenter]
addObserver: self
selector: @selector(connectionBecameInvalid:)
selector: @selector(cmdConnectionBecameInvalid:)
name: NSConnectionDidDieNotification
object: c];
EcProcConnection = c;
@ -2051,6 +2051,26 @@ NSLog(@"Ignored attempt to set timer interval to %g ... using 10.0", interval);
return 0;
}
- (void) ecTestLog: (NSString*)fmt arguments: (va_list)args
{
if (YES == cmdFlagTesting)
{
NSLogv(fmt, args);
}
}
- (void) ecTestLog: (NSString*)fmt, ...
{
if (YES == cmdFlagTesting)
{
va_list ap;
va_start (ap, fmt);
[self ecTestLog: fmt arguments: ap];
va_end (ap);
}
}
- (void) setCmdDebug: (NSString*)mode withDescription: (NSString*)desc
{
[cmdDebugKnown setObject: desc forKey: mode];