Commits

Tuukka Norri committed 6dc1efa

Logging using Log4Cocoa
- Changed almost all logging calls to use Log4Cocoa.

  • Participants
  • Parent commits 7ab23db
  • Branches PGTS

Comments (0)

Files changed (12)

File Framework/Framework.xcodeproj/project.pbxproj

 		53BA50960880501D00BFAFB5 /* PGTSAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 53BA4FEF08804EA000BFAFB5 /* PGTSAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; };
 		53BA50990880501E00BFAFB5 /* PGTS.h in Headers */ = {isa = PBXBuildFile; fileRef = 53BA4FF508804EA000BFAFB5 /* PGTS.h */; settings = {ATTRIBUTES = (Public, ); }; };
 		53BEBC5B08805EDE00EF494D /* PGTS_Prefix.pch in Headers */ = {isa = PBXBuildFile; fileRef = 32DBCF5E0370ADEE00C91783 /* PGTS_Prefix.pch */; };
+		53D0441D0B4C1E0300DB9308 /* libLog4Cocoa.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 53D044160B4C1DFD00DB9308 /* libLog4Cocoa.a */; };
 		53D72FE70A51A4B6000E47A7 /* libTSDataTypes.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 531B02680A51A1EA006AEF08 /* libTSDataTypes.a */; };
 		53D72FF30A51A5CB000E47A7 /* libTSDataTypes.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 531B02680A51A1EA006AEF08 /* libTSDataTypes.a */; };
 		53D9B38A08B5256700ADB959 /* PGTSAbstractClassInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 53D9B38808B5256700ADB959 /* PGTSAbstractClassInfo.h */; settings = {ATTRIBUTES = (Public, ); }; };
 			remoteGlobalIDString = 531977540B15C2B6000FA952;
 			remoteInfo = libpq/psql/headers;
 		};
-		53193DCD0A36CD01009747BC /* PBXContainerItemProxy */ = {
-			isa = PBXContainerItemProxy;
-			containerPortal = 531740DA0958AB340098D3D5 /* JaguarCompatibility.xcodeproj */;
-			proxyType = 2;
-			remoteGlobalIDString = 53EC467C09586CE900D22FE5;
-			remoteInfo = JaguarCompatibility;
-		};
-		53193DCF0A36CD01009747BC /* PBXContainerItemProxy */ = {
-			isa = PBXContainerItemProxy;
-			containerPortal = 531740DA0958AB340098D3D5 /* JaguarCompatibility.xcodeproj */;
-			proxyType = 2;
-			remoteGlobalIDString = 8D5B49B6048680CD000E48DA;
-			remoteInfo = JaguarCompatibilityBundle;
-		};
-		53193F960A36CD1F009747BC /* PBXContainerItemProxy */ = {
-			isa = PBXContainerItemProxy;
-			containerPortal = 531740DA0958AB340098D3D5 /* JaguarCompatibility.xcodeproj */;
-			proxyType = 1;
-			remoteGlobalIDString = 53EC467B09586CE900D22FE5;
-			remoteInfo = JaguarCompatibility;
-		};
 		531B02650A51A1EA006AEF08 /* PBXContainerItemProxy */ = {
 			isa = PBXContainerItemProxy;
 			containerPortal = 5304E3FC09575374004D0C0F /* TSDataTypes.xcodeproj */;
 			remoteGlobalIDString = 53BF4A350A36F6680065845D;
 			remoteInfo = "Static archive";
 		};
-		53608D420A5C94CD005212A7 /* PBXContainerItemProxy */ = {
-			isa = PBXContainerItemProxy;
-			containerPortal = 534CF7DA095C8EB700BF3440 /* UnitTests.xcodeproj */;
-			proxyType = 2;
-			remoteGlobalIDString = 534CFCD0095CE11A00BF3440;
-			remoteInfo = UnitTestsStatic;
-		};
-		5361BC4C0B31A3E800C9F387 /* PBXContainerItemProxy */ = {
+		53C1DF890B4BD50B007947D8 /* PBXContainerItemProxy */ = {
 			isa = PBXContainerItemProxy;
 			containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
 			proxyType = 1;
 			remoteGlobalIDString = 5361BC280B319D6600C9F387;
 			remoteInfo = "PostgreSQL-8.2.0";
 		};
-		53BD9A070A5C7CB4001C950C /* PBXContainerItemProxy */ = {
+		53D044150B4C1DFD00DB9308 /* PBXContainerItemProxy */ = {
 			isa = PBXContainerItemProxy;
-			containerPortal = 53BD9A030A5C7CB4001C950C /* TSDataTypesUnitTests.xcodeproj */;
+			containerPortal = 53C1DF760B4BD4AB007947D8 /* Log4Cocoa.xcodeproj */;
 			proxyType = 2;
-			remoteGlobalIDString = 53174802095C148D0098D3D5;
-			remoteInfo = UnitTestsStatic;
+			remoteGlobalIDString = 530EC0030B4BCDB100DFC1CA /* libLog4Cocoa.a */;
+			remoteInfo = libLog4Cocoa;
+		};
+		53D044170B4C1DFD00DB9308 /* PBXContainerItemProxy */ = {
+			isa = PBXContainerItemProxy;
+			containerPortal = 53C1DF760B4BD4AB007947D8 /* Log4Cocoa.xcodeproj */;
+			proxyType = 2;
+			remoteGlobalIDString = 53C1DF180B4BD429007947D8 /* AllTests */;
+			remoteInfo = "AllTests (Upgraded)";
+		};
+		53D044190B4C1DFD00DB9308 /* PBXContainerItemProxy */ = {
+			isa = PBXContainerItemProxy;
+			containerPortal = 53C1DF760B4BD4AB007947D8 /* Log4Cocoa.xcodeproj */;
+			proxyType = 2;
+			remoteGlobalIDString = 53C1DF1F0B4BD429007947D8 /* Documentation */;
+			remoteInfo = "Documentation (Upgraded)";
+		};
+		53D0441B0B4C1DFD00DB9308 /* PBXContainerItemProxy */ = {
+			isa = PBXContainerItemProxy;
+			containerPortal = 53C1DF760B4BD4AB007947D8 /* Log4Cocoa.xcodeproj */;
+			proxyType = 2;
+			remoteGlobalIDString = 530EBD140B4BBFAE00DFC1CA /* Log4Cocoa.framework */;
+			remoteInfo = Log4Cocoa;
+		};
+		53D044200B4C1E0D00DB9308 /* PBXContainerItemProxy */ = {
+			isa = PBXContainerItemProxy;
+			containerPortal = 53C1DF760B4BD4AB007947D8 /* Log4Cocoa.xcodeproj */;
+			proxyType = 1;
+			remoteGlobalIDString = 530EC0020B4BCDB100DFC1CA /* libLog4Cocoa */;
+			remoteInfo = libLog4Cocoa;
 		};
 		53F524D50A51A28900E7DDC4 /* PBXContainerItemProxy */ = {
 			isa = PBXContainerItemProxy;
 		530323C3088062270024E7EF /* NDRunLoopMessenger.h */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.h; name = NDRunLoopMessenger.h; path = Contrib/NDRunLoopMessenger.h; sourceTree = "<group>"; };
 		530323C4088062270024E7EF /* NDRunLoopMessenger.m */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.objc; name = NDRunLoopMessenger.m; path = Contrib/NDRunLoopMessenger.m; sourceTree = "<group>"; };
 		5304E3FC09575374004D0C0F /* TSDataTypes.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = TSDataTypes.xcodeproj; path = ../Dependencies/TSDataTypes/TSDataTypes.xcodeproj; sourceTree = SOURCE_ROOT; };
-		531740DA0958AB340098D3D5 /* JaguarCompatibility.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = JaguarCompatibility.xcodeproj; path = ../JaguarCompatibility/JaguarCompatibility.xcodeproj; sourceTree = SOURCE_ROOT; };
 		5325EAD70A1B2EF600FEA842 /* postgresql */ = {isa = PBXFileReference; lastKnownFileType = folder; name = postgresql; path = "PGTS-PostgreSQL/postgresql"; sourceTree = BUILT_PRODUCTS_DIR; };
 		53298DDE0B3307A800DE7CC8 /* PGTSRoleDescription.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PGTSRoleDescription.h; path = Sources/PGTSRoleDescription.h; sourceTree = "<group>"; };
 		53298DDF0B3307A800DE7CC8 /* PGTSRoleDescription.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = PGTSRoleDescription.m; path = Sources/PGTSRoleDescription.m; sourceTree = "<group>"; };
 		533A6AF209DEE51700D28AB0 /* PGTSConstants.h */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.h; name = PGTSConstants.h; path = Sources/PGTSConstants.h; sourceTree = "<group>"; };
 		534C024B096054EA00BF3440 /* PGTSConnectionPoolItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PGTSConnectionPoolItem.h; path = Sources/PGTSConnectionPoolItem.h; sourceTree = "<group>"; };
 		534C024C096054EA00BF3440 /* PGTSConnectionPoolItem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = PGTSConnectionPoolItem.m; path = Sources/PGTSConnectionPoolItem.m; sourceTree = "<group>"; };
-		534CF7DA095C8EB700BF3440 /* UnitTests.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = UnitTests.xcodeproj; path = ../UnitTests/UnitTests.xcodeproj; sourceTree = SOURCE_ROOT; };
 		534CFECB095DCCDC00BF3440 /* Kerberos.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Kerberos.framework; path = /System/Library/Frameworks/Kerberos.framework; sourceTree = "<absolute>"; };
 		53594D1B0B13711300378707 /* libpq.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libpq.a; path = "PGTS-PostgreSQL/universal/lib/libpq.a"; sourceTree = BUILT_PRODUCTS_DIR; };
 		5359557C0A514DEE0008793A /* PGTSSchemaDescriptor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PGTSSchemaDescriptor.h; path = Sources/PGTSSchemaDescriptor.h; sourceTree = "<group>"; };
 		53BA4FF508804EA000BFAFB5 /* PGTS.h */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.h; name = PGTS.h; path = Sources/PGTS.h; sourceTree = "<group>"; };
 		53BA503708804F9A00BFAFB5 /* PGTS.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = PGTS.framework; sourceTree = BUILT_PRODUCTS_DIR; };
 		53BA503E08804FBC00BFAFB5 /* psql */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; name = psql; path = "PGTS-PostgreSQL/universal/bin/psql"; sourceTree = BUILT_PRODUCTS_DIR; };
-		53BD9A030A5C7CB4001C950C /* TSDataTypesUnitTests.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = TSDataTypesUnitTests.xcodeproj; path = ../Dependencies/TSDataTypes/UnitTests/TSDataTypesUnitTests.xcodeproj; sourceTree = SOURCE_ROOT; };
+		53C1DF760B4BD4AB007947D8 /* Log4Cocoa.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = Log4Cocoa.xcodeproj; path = Contrib/Log4Cocoa/Log4Cocoa.xcodeproj; sourceTree = "<group>"; };
 		53D9B38808B5256700ADB959 /* PGTSAbstractClassInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PGTSAbstractClassInfo.h; path = Sources/PGTSAbstractClassInfo.h; sourceTree = "<group>"; };
 		53D9B38908B5256700ADB959 /* PGTSAbstractClassInfo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = PGTSAbstractClassInfo.m; path = Sources/PGTSAbstractClassInfo.m; sourceTree = "<group>"; };
 		53D9B4C608B5492C00ADB959 /* PGTSTypeInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PGTSTypeInfo.h; path = Sources/PGTSTypeInfo.h; sourceTree = "<group>"; };
 				53D72FF30A51A5CB000E47A7 /* libTSDataTypes.a in Frameworks */,
 				53E11A100A7919CE00D0107C /* ExceptionHandling.framework in Frameworks */,
 				53594D1C0B13711300378707 /* libpq.a in Frameworks */,
+				53D0441D0B4C1E0300DB9308 /* libLog4Cocoa.a in Frameworks */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
 			isa = PBXGroup;
 			children = (
 				5304E3FC09575374004D0C0F /* TSDataTypes.xcodeproj */,
-				53BD9A030A5C7CB4001C950C /* TSDataTypesUnitTests.xcodeproj */,
-				531740DA0958AB340098D3D5 /* JaguarCompatibility.xcodeproj */,
-				534CF7DA095C8EB700BF3440 /* UnitTests.xcodeproj */,
+				53C1DF760B4BD4AB007947D8 /* Log4Cocoa.xcodeproj */,
 				53BA503E08804FBC00BFAFB5 /* psql */,
 				53594D1B0B13711300378707 /* libpq.a */,
 				0867D69BFE84028FC02AAC07 /* Foundation.framework */,
 			name = ConnectionPool;
 			sourceTree = "<group>";
 		};
-		53193DC90A36CD01009747BC /* Products */ = {
-			isa = PBXGroup;
-			children = (
-				53193DCE0A36CD01009747BC /* JaguarCompatibility.framework */,
-				53193DD00A36CD01009747BC /* JaguarCompatibility.bundle */,
-			);
-			name = Products;
-			sourceTree = "<group>";
-		};
 		531B02600A51A1EA006AEF08 /* Products */ = {
 			isa = PBXGroup;
 			children = (
 			name = WriteDelegate;
 			sourceTree = "<group>";
 		};
-		534CF7DB095C8EB700BF3440 /* Products */ = {
-			isa = PBXGroup;
-			children = (
-				53608D430A5C94CD005212A7 /* UnitTestsStatic.octest */,
-			);
-			name = Products;
-			sourceTree = "<group>";
-		};
 		5359784908AF660F000CAC2B /* Metadata */ = {
 			isa = PBXGroup;
 			children = (
 			name = Connection;
 			sourceTree = "<group>";
 		};
-		53BD9A040A5C7CB4001C950C /* Products */ = {
+		53D0440F0B4C1DFD00DB9308 /* Products */ = {
 			isa = PBXGroup;
 			children = (
-				53BD9A080A5C7CB4001C950C /* UnitTestsStatic.octest */,
+				53D044160B4C1DFD00DB9308 /* libLog4Cocoa.a */,
+				53D044180B4C1DFD00DB9308 /* AllTests */,
+				53D0441A0B4C1DFD00DB9308 /* Documentation */,
+				53D0441C0B4C1DFD00DB9308 /* Log4Cocoa.framework */,
 			);
 			name = Products;
 			sourceTree = "<group>";
 			);
 			dependencies = (
 				53F524D60A51A28900E7DDC4 /* PBXTargetDependency */,
-				5361BC4D0B31A3E800C9F387 /* PBXTargetDependency */,
+				53D044210B4C1E0D00DB9308 /* PBXTargetDependency */,
+				53C1DF8A0B4BD50B007947D8 /* PBXTargetDependency */,
 			);
 			name = "Static archive";
 			productName = "Static archive";
 			);
 			dependencies = (
 				2B6D85980B1DCC55008DE4E2 /* PBXTargetDependency */,
-				53193F970A36CD1F009747BC /* PBXTargetDependency */,
 			);
 			name = Framework;
 			productName = PGTS;
 			projectDirPath = "";
 			projectReferences = (
 				{
-					ProductGroup = 53193DC90A36CD01009747BC /* Products */;
-					ProjectRef = 531740DA0958AB340098D3D5 /* JaguarCompatibility.xcodeproj */;
+					ProductGroup = 53D0440F0B4C1DFD00DB9308 /* Products */;
+					ProjectRef = 53C1DF760B4BD4AB007947D8 /* Log4Cocoa.xcodeproj */;
 				},
 				{
 					ProductGroup = 531B02600A51A1EA006AEF08 /* Products */;
 					ProjectRef = 5304E3FC09575374004D0C0F /* TSDataTypes.xcodeproj */;
 				},
-				{
-					ProductGroup = 53BD9A040A5C7CB4001C950C /* Products */;
-					ProjectRef = 53BD9A030A5C7CB4001C950C /* TSDataTypesUnitTests.xcodeproj */;
-				},
-				{
-					ProductGroup = 534CF7DB095C8EB700BF3440 /* Products */;
-					ProjectRef = 534CF7DA095C8EB700BF3440 /* UnitTests.xcodeproj */;
-				},
 			);
 			targets = (
 				536580D10A36FDFB00CDEC90 /* Static archive */,
 /* End PBXProject section */
 
 /* Begin PBXReferenceProxy section */
-		53193DCE0A36CD01009747BC /* JaguarCompatibility.framework */ = {
-			isa = PBXReferenceProxy;
-			fileType = wrapper.framework;
-			path = JaguarCompatibility.framework;
-			remoteRef = 53193DCD0A36CD01009747BC /* PBXContainerItemProxy */;
-			sourceTree = BUILT_PRODUCTS_DIR;
-		};
-		53193DD00A36CD01009747BC /* JaguarCompatibility.bundle */ = {
-			isa = PBXReferenceProxy;
-			fileType = wrapper.cfbundle;
-			path = JaguarCompatibility.bundle;
-			remoteRef = 53193DCF0A36CD01009747BC /* PBXContainerItemProxy */;
-			sourceTree = BUILT_PRODUCTS_DIR;
-		};
 		531B02660A51A1EA006AEF08 /* TSDataTypes.framework */ = {
 			isa = PBXReferenceProxy;
 			fileType = wrapper.framework;
 			remoteRef = 531B02670A51A1EA006AEF08 /* PBXContainerItemProxy */;
 			sourceTree = BUILT_PRODUCTS_DIR;
 		};
-		53608D430A5C94CD005212A7 /* UnitTestsStatic.octest */ = {
+		53D044160B4C1DFD00DB9308 /* libLog4Cocoa.a */ = {
 			isa = PBXReferenceProxy;
-			fileType = wrapper.cfbundle;
-			path = UnitTestsStatic.octest;
-			remoteRef = 53608D420A5C94CD005212A7 /* PBXContainerItemProxy */;
+			fileType = archive.ar;
+			path = libLog4Cocoa.a;
+			remoteRef = 53D044150B4C1DFD00DB9308 /* PBXContainerItemProxy */;
 			sourceTree = BUILT_PRODUCTS_DIR;
 		};
-		53BD9A080A5C7CB4001C950C /* UnitTestsStatic.octest */ = {
+		53D044180B4C1DFD00DB9308 /* AllTests */ = {
 			isa = PBXReferenceProxy;
-			fileType = wrapper.cfbundle;
-			path = UnitTestsStatic.octest;
-			remoteRef = 53BD9A070A5C7CB4001C950C /* PBXContainerItemProxy */;
+			fileType = "compiled.mach-o.executable";
+			path = AllTests;
+			remoteRef = 53D044170B4C1DFD00DB9308 /* PBXContainerItemProxy */;
+			sourceTree = BUILT_PRODUCTS_DIR;
+		};
+		53D0441A0B4C1DFD00DB9308 /* Documentation */ = {
+			isa = PBXReferenceProxy;
+			fileType = "compiled.mach-o.executable";
+			path = Documentation;
+			remoteRef = 53D044190B4C1DFD00DB9308 /* PBXContainerItemProxy */;
+			sourceTree = BUILT_PRODUCTS_DIR;
+		};
+		53D0441C0B4C1DFD00DB9308 /* Log4Cocoa.framework */ = {
+			isa = PBXReferenceProxy;
+			fileType = wrapper.framework;
+			path = Log4Cocoa.framework;
+			remoteRef = 53D0441B0B4C1DFD00DB9308 /* PBXContainerItemProxy */;
 			sourceTree = BUILT_PRODUCTS_DIR;
 		};
 /* End PBXReferenceProxy section */
 			target = 531977540B15C2B6000FA952 /* PostgreSQL-8.1.5 */;
 			targetProxy = 2B6D85970B1DCC55008DE4E2 /* PBXContainerItemProxy */;
 		};
-		53193F970A36CD1F009747BC /* PBXTargetDependency */ = {
-			isa = PBXTargetDependency;
-			name = JaguarCompatibility;
-			targetProxy = 53193F960A36CD1F009747BC /* PBXContainerItemProxy */;
-		};
-		5361BC4D0B31A3E800C9F387 /* PBXTargetDependency */ = {
+		53C1DF8A0B4BD50B007947D8 /* PBXTargetDependency */ = {
 			isa = PBXTargetDependency;
 			target = 5361BC280B319D6600C9F387 /* PostgreSQL-8.2.0 */;
-			targetProxy = 5361BC4C0B31A3E800C9F387 /* PBXContainerItemProxy */;
+			targetProxy = 53C1DF890B4BD50B007947D8 /* PBXContainerItemProxy */;
+		};
+		53D044210B4C1E0D00DB9308 /* PBXTargetDependency */ = {
+			isa = PBXTargetDependency;
+			name = libLog4Cocoa;
+			targetProxy = 53D044200B4C1E0D00DB9308 /* PBXContainerItemProxy */;
 		};
 		53F524D60A51A28900E7DDC4 /* PBXTargetDependency */ = {
 			isa = PBXTargetDependency;

File Framework/Sources/PGTSAdditions.m

 #import "PGTSFieldInfo.h"
 #import "PGTSDatabaseInfo.h"
 #import "PGTSACLItem.h"
+#import <Log4Cocoa/Log4Cocoa.h>
 
 
 //A workaround for libpq versions earlier than 8.0.8 and 8.1.4
 
 @implementation NSData (PGTSAdditions)
 //TODO: -PGTSParameterLength:
-//Pit��k� k�ytt�� funktiota htonl tai vastaavaa?
+//Should we use htonl?
 + (id) newForPGTSResultSet: (PGTSResultSet *) set withCharacters: (char *) value typeInfo: (PGTSTypeInfo *) typeInfo
 {
 	size_t resultLength = 0;
 	
 	if (NULL == unescaped)
 	{
-		NSLog(@"-[%@ %@] ERROR! PQunescapeBytea failed.", [self className], NSStringFromSelector(_cmd)); // TODO! Handle error better?
+		log4Error (@"PQunescapeBytea failed for characters: %s", value); //FIXME: Handle error?
 		return nil;
 	}
 	

File Framework/Sources/PGTSConnection.m

 
 #define USE_ASSERTIONS 1
 
-#import <PGTS/PGTSConnectionPrivate.h>
-#import <PGTS/PGTSConnection.h>
-#import <PGTS/PGTSResultSetPrivate.h>
-#import <PGTS/PGTSResultSet.h>
-#import <PGTS/PGTSAdditions.h>
-#import <PGTS/PGTSConnectionPool.h>
-#import <PGTS/PGTSConstants.h>
-#import <PGTS/PGTSConnectionDelegate.h>
-#import <PGTS/PGTSFunctions.h>
-#import <PGTS/PGTSDatabaseInfo.h>
+#import "PGTSConnectionPrivate.h"
+#import "PGTSConnection.h"
+#import "PGTSResultSetPrivate.h"
+#import "PGTSResultSet.h"
+#import "PGTSAdditions.h"
+#import "PGTSConnectionPool.h"
+#import "PGTSConstants.h"
+#import "PGTSConnectionDelegate.h"
+#import "PGTSFunctions.h"
+#import "PGTSDatabaseInfo.h"
 #import <TSDataTypes/TSDataTypes.h>
+#import <Log4Cocoa/Log4Cocoa.h>
 
 
 /** \cond */
     [connectionString release];
     [initialCommands release];
     
-    NSLog (@"Deallocating db connection: %p", self);
+    log4Debug (@"Deallocating db connection: %p", self);
     [super dealloc];
 }
 
 #define SetIf( VALUE, KEY ) if ((VALUE)) [connectionDict setObject: VALUE forKey: KEY];
 - (BOOL) setConnectionURL: (NSURL *) url
 {
-    NSLog (@"url: %@", url);
+    log4Debug (@"Connection URL: %@", url);
     BOOL rval = NO;
     if (0 == [@"pgsql" caseInsensitiveCompare: [url scheme]])
     {

File Framework/Sources/PGTSConnectionPool.m

 // $Id$
 //
 
-#import <PGTS/PGTSConnectionPool.h>
-#import <PGTS/PGTSConnectionPoolItem.h>
-#import <PGTS/PGTSFunctions.h>
-#import <PGTS/PGTSDatabaseInfo.h>
-
+#import "PGTSConnectionPool.h"
+#import "PGTSConnectionPoolItem.h"
+#import "PGTSFunctions.h"
+#import "PGTSDatabaseInfo.h"
+#import <Log4Cocoa/Log4Cocoa.h>
 
 /** \cond */
 static void
  */
 - (void) removeConnection: (PGTSConnection *) conn
 {
-    PGTSLog (@"pool removeConnection: %@ (%p)", conn, conn);
+    log4Debug (@"pool removeConnection: %@ (%p)", conn, conn);
     NSString* key = [conn connectionPoolKey];
     PGTSConnectionPoolItem* item = [pool objectForKey: key];
     [item removeConnection: conn];

File Framework/Sources/PGTSConnectionPoolItem.m

 // $Id$
 //
 
-#import <PGTS/PGTSConnectionPoolItem.h>
-#import <PGTS/PGTSFunctions.h>
-#import <PGTS/PGTSConstants.h>
-#import <PGTS/PGTSDatabaseInfo.h>
-
+#import "PGTSConnectionPoolItem.h"
+#import "PGTSFunctions.h"
+#import "PGTSConstants.h"
+#import "PGTSDatabaseInfo.h"
+#import <Log4Cocoa/Log4Cocoa.h>
 
 /**
  * Package containing database information and open connections.
  */
 - (void) addConnection: (PGTSConnection *) connection
 {
-    PGTSLog (@"item: %@ (%p) addConnection: %@ (%p)", self, self, connection, connection);
+    log4Debug (@"item: %@ (%p) addConnection: %@ (%p)", self, self, connection, connection);
     [connections addObject: connection];
     NSDictionary* userInfo = [NSDictionary dictionaryWithObject: connection forKey: kPGTSConnectionKey];
     [[NSNotificationCenter defaultCenter] postNotificationName: kPGTSConnectionPoolItemDidAddConnectionNotification
  */
 - (void) removeConnection: (PGTSConnection *) connection
 {
-    PGTSLog (@"item: %@ (%p) removeConnection: %@ (%p)", self, self, connection, connection);
+    log4Debug (@"item: %@ (%p) removeConnection: %@ (%p)", self, self, connection, connection);
     [connections removeObject: connection];
     NSDictionary* userInfo = [NSDictionary dictionaryWithObject: connection forKey: kPGTSConnectionKey];
     [[NSNotificationCenter defaultCenter] postNotificationName: kPGTSConnectionPoolItemDidRemoveConnectionNotification

File Framework/Sources/PGTSConnectionPrivate.m

 #import <sys/types.h>
 #import <sys/time.h>
 #import <unistd.h>
-#import <PGTS/TSRunloopMessenger.h>
-#import <PGTS/PGTSConnectionPrivate.h>
-#import <PGTS/PGTSConstants.h>
-#import <PGTS/PGTSFunctions.h>
-#import <PGTS/PGTSConnectionDelegate.h>
-#import <PGTS/PGTSConnectionPool.h>
-#import <PGTS/PGTSExceptions.h>
+#import "TSRunloopMessenger.h"
+#import "PGTSConnectionPrivate.h"
+#import "PGTSConstants.h"
+#import "PGTSFunctions.h"
+#import "PGTSConnectionDelegate.h"
+#import "PGTSConnectionPool.h"
+#import "PGTSExceptions.h"
+#import <Log4Cocoa/Log4Cocoa.h>
 
 
 static NSNotification* 
 @implementation PGTSConnection (ProxyMethods)
 
 /**
-* Send query dispatch status to the delegate
+ * Send query dispatch status to the delegate
  * Afterwards collect the results and send them as well
  */
 - (void) sendDispatchStatusToDelegate: (int) status forQuery: (NSString *) queryString
     }
     socket = nil;
 
-    NSLog (@"Worker: exiting");
+    log4Debug (@"Worker: exiting");
     workerProxy = nil;
     returningWorkerProxy = nil;
     [threadPool release];    
     int bsdSocket = PQsocket (connection);
     
     if (bsdSocket <= 0)
-        PGTSLog (@"Unable to get connection socket from libpq");
+        log4Error (@"Unable to get connection socket from libpq");
     else
     {
         if (YES == reset)
 - (void) workerEnd
 {
     //A dummy method to cause some action in the run loop.
-    NSLog (@"workerEnd");
+    log4Debug (@"workerEnd");
 }
 
 - (void) logQuery: (NSString *) query parameters: (NSArray *) parameters
 {
-    fprintf (stdout, "(%p) %s %s\n", self, [[query description] UTF8String], [[parameters description] UTF8String]);
+    log4Info (@"(%p) %s %s\n", self, query, parameters);
 }
 
 - (void) logNotice: (id) anObject
 {
-    fprintf (stdout, "(%p) *** %s", self, [[anObject description] UTF8String]);
+    log4Info (@"(%p) NOTICE: %s", self, anObject);
 }
 
 - (void) logNotification: (id) anObject
 {
-    //fprintf (stdout, "(%p) *** NOTIFY: %s\n", self, [[anObject description] UTF8String]);
+    log4Debug (@"(%p) *** NOTIFY: %s\n", self, anObject);
 }
 
 /** Called when data is available from the libpq socket */
 - (void) dataAvailableFromLib: (NSNotification *) aNotification
 {
-    //PGTSLog (@"worker: availableData thread: %p", [NSThread currentThread]);
+    log4Debug (@"worker: availableData thread: %p", [NSThread currentThread]);
     [connectionLock lock];
     PQconsumeInput (connection);
     [self postPGnotifications];
     {
         NSNotification* notification = PGTSExtractPgNotification (self, pgNotification);
         [self logNotification: [notification name]];
-        PGTSLog (@"Posting notification: %@", notification);
+        log4Debug (@"Posting notification: %@", notification);
         [postgresNotificationCenter performSelectorOnMainThread: @selector (postNotification:)
                                                      withObject: notification
                                                   waitUntilDone: NO];
                 NS_ENDHANDLER
         }
             connectionStatus = tempStatus;
-            PGTSLog (@"ConnectionStatus: %d", connectionStatus);
+            log4Debug (@"ConnectionStatus: %d", connectionStatus);
             if (YES == allowKVO) [self didChangeValueForKey: @"connectionStatus"];
     }
 }

File Framework/Sources/PGTSFunctions.h

      nil != LOOP_VAR; LOOP_VAR = [ENUMERATOR_VAR nextObject])
 
 
-#ifdef LOG_ERRORS
-#define PGTSLog(...) PGTSLog2 (__FILE__, __LINE__, __VA_ARGS__)
-#else
-#define PGTSLog(...) 
-#endif
-
-
 extern inline id PGTSOidAsObject (Oid o);
 extern void PGTSInit ();
-extern void PGTSLog2 (char* path, int line, NSString* format, ...);
 extern void PGTSNoticeProcessor (void* sender, const char* message);
 extern NSString* PGTSModificationName (unichar type);
 extern NSString* PGTSLockOperation (unichar type);

File Framework/Sources/PGTSFunctions.m

 
 
 void 
-PGTSLog2 (char* path, int line, NSString* format, ...)
-{
-    va_list ap;
-    va_start (ap, format);
-    
-    fprintf (stderr, "PGTS (%s:%d): ", basename (path), line);
-    NSLogv (format, ap);
-    
-    va_end (ap);    
-}
-
-
-void 
 PGTSInit ()
 {   
     static int tooLate = 0;

File Framework/Sources/PGTSModificationNotifier.m

 
 #import <Foundation/Foundation.h>
 #import <TSDataTypes/TSDataTypes.h>
+#import <Log4Cocoa/Log4Cocoa.h>
 #import <PGTS/postgresql/libpq-fe.h>
 #import "PGTSModificationNotifier.h"
 #import "PGTSNotifier.h"
 - (BOOL) addObserver: (id) anObject selector: (SEL) aSelector table: (PGTSTableInfo *) tableInfo 
     notificationName: (NSString *) notificationName
 {
-    PGTSLog (@"addObserver: %@ name: %@", anObject, notificationName);
+    log4Debug (@"addObserver: %@ name: %@", anObject, notificationName);
     BOOL rval =  [self addObserver: anObject selector: aSelector 
                             table: tableInfo notificationName: notificationName 
                 notificationQuery: @"SELECT " PGTS_SCHEMA_NAME ".ObserveModifications ($1) AS nname" ];

File Framework/Sources/PGTSNotifier.m

 #import "PGTSTableInfo.h"
 #import "PGTSDatabaseInfo.h"
 #import "PGTSConnectionDelegate.h"
-
+#import <Log4Cocoa/Log4Cocoa.h>
 
 //FIXME: change this so that being connection specific is actually enforced
 
                 
         PGTSResultSet* res = [connection executeQuery: query
                                            parameters: PGTSOidAsObject (oid)];
-        PGTSLog (@"Notification query res: %@", res);
+        log4Debug (@"Notification query res: %@", res);
         if (YES == [res querySucceeded])
         {
             rval = YES;
 #endif
             [notificationNames setObject: nname atIndex: oid];
             
-            PGTSLog (@"Notification name: %@", nname);
+            log4Debug (@"Notification name: %@", nname);
             [connection startListening: self forNotification: nname
                               selector: @selector (handleNotification:) sendQuery: NO];
         }

File Framework/Sources/PGTSResultSet.m

 #import <limits.h>
 #import <PGTS/postgresql/libpq-fe.h> 
 #import <TSDataTypes/TSDataTypes.h>
+#import <Log4Cocoa/Log4Cocoa.h>
 #import "PGTSResultSet.h"
 #import "PGTSResultSetPrivate.h"
 #import "PGTSAdditions.h"
 
 - (void) logError
 {
-    fprintf (stderr, "*** Result error: %s\n", PQresultErrorMessage (result));
+    log4Info (@"Result error: %s", PQresultErrorMessage (result));
 }
 
 @end

File Framework/xcconfig/basic.xcconfig

 GCC_SYMBOLS_PRIVATE_EXTERN = NO
 GCC_TREAT_WARNINGS_AS_ERRORS = YES
 GCC_USE_GCC3_PFE_SUPPORT = YES
-HEADER_SEARCH_PATHS = $(BUILT_PRODUCTS_DIR) $(BUILT_PRODUCTS_DIR)/PGTS-PostgreSQL $(SRCROOT)/../Dependencies/TSDataTypes/build/$(BUILD_STYLE) .
-LIBRARY_SEARCH_PATHS = $(BUILT_PRODUCTS_DIR)/PGTS-PostgreSQL/universal/lib $(BUILT_PRODUCTS_DIR) $(SRCROOT)/../Dependencies/TSDataTypes/build/$(BUILD_STYLE) $(SDKROOT_$(arch))/usr/lib
+HEADER_SEARCH_PATHS = $(BUILT_PRODUCTS_DIR) $(BUILT_PRODUCTS_DIR)/PGTS-PostgreSQL $(SRCROOT)/../Dependencies/TSDataTypes/build/$(BUILD_STYLE) $(SRCROOT)/Contrib/Log4Cocoa/build/$(BUILD_STYLE) .
+LIBRARY_SEARCH_PATHS = $(BUILT_PRODUCTS_DIR)/PGTS-PostgreSQL/universal/lib $(BUILT_PRODUCTS_DIR) $(SRCROOT)/../Dependencies/TSDataTypes/build/$(BUILD_STYLE) $(SRCROOT)/Contrib/Log4Cocoa/build/$(BUILD_STYLE) $(SDKROOT_$(arch))/usr/lib
 FRAMEWORK_SEARCH_PATHS = $(SDKROOT_$(arch))/System/Library/Frameworks $(BUILT_PRODUCTS_DIR)
 LINK_WITH_STANDARD_LIBRARIES = YES
 SKIP_INSTALL = YES