httpclient_listener: Don't use print()...

Fri, 29 May 2009 22:04:57 +0100

author
Matthew Wild <mwild1@gmail.com>
date
Fri, 29 May 2009 22:04:57 +0100
changeset 1227
6a587ca99109
parent 1226
3b5f9dac2045
child 1229
331a68645f67

httpclient_listener: Don't use print()...

net/httpclient_listener.lua file | annotate | diff | comparison | revisions
--- a/net/httpclient_listener.lua	Fri May 29 23:23:56 2009 +0500
+++ b/net/httpclient_listener.lua	Fri May 29 22:04:57 2009 +0100
@@ -1,7 +1,7 @@
+local log = require "util.logger".init("httpclient_listener");
 
 local connlisteners_register = require "net.connlisteners".register;
 
-
 local requests = {}; -- Open requests
 local buffers = {}; -- Buffers of partial lines
 
@@ -11,7 +11,7 @@
 	local request = requests[conn];
 
 	if not request then
-		print("NO REQUEST!! for "..tostring(conn));
+		log("warn", "Received response from connection %s with no request attached!", tostring(conn));
 		return;
 	end
 
@@ -29,7 +29,7 @@
 end
 
 function httpclient.register_request(conn, req)
-	print("Registering a request for "..tostring(conn));
+	log("debug", "Attaching request %s to connection %s", tostring(req.id or req), tostring(conn));
 	requests[conn] = req;
 end
 

mercurial