From 72c8b2514c59965ea2a4c78fb8919943e53101d0 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sun, 26 Jul 2009 12:23:32 -0400 Subject: [PATCH] Make the transport logging an environmental setting. To enable: `setenv TransportDebug YES`. --- MacGDBp.xcodeproj/project.pbxproj | 1 - Source/GDBpConnection.m | 10 ++++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/MacGDBp.xcodeproj/project.pbxproj b/MacGDBp.xcodeproj/project.pbxproj index 2345e97..257624e 100644 --- a/MacGDBp.xcodeproj/project.pbxproj +++ b/MacGDBp.xcodeproj/project.pbxproj @@ -506,7 +506,6 @@ GCC_C_LANGUAGE_STANDARD = c99; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; - OTHER_CFLAGS = "-DBLU_DEBUG"; PREBINDING = NO; SDKROOT = /Developer/SDKs/MacOSX10.5.sdk; }; diff --git a/Source/GDBpConnection.m b/Source/GDBpConnection.m index 96a1700..fd5096e 100644 --- a/Source/GDBpConnection.m +++ b/Source/GDBpConnection.m @@ -268,9 +268,8 @@ NSString* format = [[NSString alloc] initWithFormat:cmd arguments:argList]; // format the command va_end(argList); -#ifdef BLU_DEBUG - NSLog(@"--> %@", format); -#endif + if ([[[[NSProcessInfo processInfo] environment] objectForKey:@"TransportDebug"] boolValue]) + NSLog(@"--> %@", cmd); return [NSString stringWithFormat:@"%@ -i %@", [format autorelease], session]; } @@ -302,9 +301,8 @@ return nil; } -#ifdef BLU_DEBUG - NSLog(@"<-- %@", doc); -#endif + if ([[[[NSProcessInfo processInfo] environment] objectForKey:@"TransportDebug"] boolValue]) + NSLog(@"<-- %@", doc); return [doc autorelease]; } -- 2.43.5