 import HTTPSerializer
 import S4
 import ConnectionPool
+// import Log
+// import StandardOutputAppender
 
 public class CrateIO {
 
-    var socketPool : ConnectionPool<TCPClientSocket>
+  // var logger = Logger(name: "CrateIO", appender: StandardOutputAppender())
+
+// public init(name: String, appender: Appender, levels: Log.Level = .all) {
+//     appenders.append(appender)
+//     self.levels = levels
+//     self.name = name
+// }
+
+
+    var socketPool : ConnectionPool<TCPConnection>
     var currentSocket = -1
 
-    public init(pool connections: [TCPClientSocket], using configuration: CratePoolConfiguration) throws {
-		    socketPool = ConnectionPool<TCPClientSocket>(pool: connections, using: configuration)
+    public init(pool connections: [TCPConnection], using configuration: CratePoolConfiguration) throws {
+		    socketPool = ConnectionPool<TCPConnection>(pool: connections, using: configuration)
     }
 
 
     public func sql (statement: String) throws -> JSON? {
 
+      // logger.log(statement)
         // Get a connection from the pool to use.
 	    return try socketPool.with({ connection in
 // print(ObjectIdentifier(connection).hashValue)

	        let request = try Request(method: .post, uri: "/_sql", headers: headers, body: post)

	        let requestData = Data(try self.requestToString(request))
	        try! connection.send(requestData)

	        //receiving data
	        let received = try connection.receive(lowWaterMark: 1, highWaterMark: 1024*1024)

	        //converting data to a string
	        let str = try String(data: received)

	        // print("received: \(str)")

	        let parser = ResponseParser()


	        try! connection.send(Data(self.requestToString(request)))

	        //receiving data
	        let received = try connection.receive(max: 1024)
	        //converting data to a string
	        let str = try String(data: received)

