mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 09:04:13 +00:00
Add some debug
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@27152 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
446cf817fb
commit
983cb4e634
1 changed files with 17 additions and 1 deletions
18
Tools/gdnc.m
18
Tools/gdnc.m
|
@ -39,6 +39,7 @@
|
|||
#define NSIG 32
|
||||
#endif
|
||||
|
||||
static BOOL debugging = NO;
|
||||
static BOOL is_daemon = NO; /* Currently running as daemon. */
|
||||
static BOOL auto_stop = NO; /* Should we shut down when unused? */
|
||||
static char ebuf[2048];
|
||||
|
@ -197,6 +198,11 @@ ihandler(int sig)
|
|||
RELEASE(info);
|
||||
[super dealloc];
|
||||
}
|
||||
- (NSString*) description
|
||||
{
|
||||
return [NSString stringWithFormat: @"%@ Name:'%@' Object:'%@' Info:'%@'",
|
||||
[super description], name, object, info];
|
||||
}
|
||||
+ (GDNCNotification*) notificationWithName: (NSString*)notificationName
|
||||
object: (NSString*)notificationObject
|
||||
data: (NSData*)notificationData
|
||||
|
@ -524,6 +530,10 @@ ihandler(int sig)
|
|||
GDNCObserver *obs;
|
||||
NSConnection *connection;
|
||||
|
||||
if (debugging)
|
||||
NSLog(@"Adding observer %lu for %@ %@",
|
||||
anObserver, notificationName, anObject);
|
||||
|
||||
connection = [(NSDistantObject*)client connectionForProxy];
|
||||
clients = (NSMapTable*)NSMapGet(connections, connection);
|
||||
if (clients == 0)
|
||||
|
@ -803,6 +813,8 @@ ihandler(int sig)
|
|||
NS_DURING
|
||||
{
|
||||
[obs->queue removeObjectAtIndex: 0];
|
||||
if (debugging)
|
||||
NSLog(@"Posting to observer %lu with %@", obs->observer, n);
|
||||
[obs->client->client postNotificationName: n->name
|
||||
object: n->object
|
||||
userInfo: n->info
|
||||
|
@ -822,6 +834,11 @@ ihandler(int sig)
|
|||
|
||||
- (void) removeObserver: (GDNCObserver*)observer
|
||||
{
|
||||
if (debugging)
|
||||
NSLog(@"Removing observer %lu for %@ %@",
|
||||
observer->observer, observer->notificationName,
|
||||
observer->notificationObject);
|
||||
|
||||
if (observer->notificationObject)
|
||||
{
|
||||
NSMutableArray *objList;
|
||||
|
@ -1048,7 +1065,6 @@ main(int argc, char** argv, char** env)
|
|||
{
|
||||
GDNCServer *server;
|
||||
BOOL subtask = YES;
|
||||
BOOL debugging = NO;
|
||||
NSProcessInfo *pInfo;
|
||||
NSMutableArray *args;
|
||||
CREATE_AUTORELEASE_POOL(pool);
|
||||
|
|
Loading…
Reference in a new issue