Author: arekm                        Date: Wed Feb 11 19:37:35 2009 GMT
Module: pld-builder.new               Tag: HEAD
---- Log message:
- log things instead of printing on stdout.

---- Files affected:
pld-builder.new/PLD_Builder:
   request_handler_server.py (1.6 -> 1.7) 

---- Diffs:

================================================================
Index: pld-builder.new/PLD_Builder/request_handler_server.py
diff -u pld-builder.new/PLD_Builder/request_handler_server.py:1.6 
pld-builder.new/PLD_Builder/request_handler_server.py:1.7
--- pld-builder.new/PLD_Builder/request_handler_server.py:1.6   Sun Feb  8 
17:18:42 2009
+++ pld-builder.new/PLD_Builder/request_handler_server.py       Wed Feb 11 
20:37:30 2009
@@ -23,6 +23,7 @@
                        length = int(self.headers.getheader('content-length'))
                        ctype, pdict = 
cgi.parse_header(self.headers.getheader('content-type'))
                        if ctype != 'application/x-www-form-urlencoded':
+                log.error("request_handler_server: [%s]: 401 Unauthorized" % 
client_address[0])
                                self.send_error(401)
                                self.end_headers()
                                return
@@ -32,7 +33,7 @@
                        filename = self.headers.getheader('x-filename')
 
                        if not request_handler.handle_request_main(query, 
filename = filename):
-                               log.error("request_handler_server: 
handle_request_main(..., %s) failed" % filename)
+                               log.error("request_handler_server: [%s]: 
handle_request_main(..., %s) failed" % (client_address[0], filename))
                                self.send_error(500)
                                self.end_headers()
                                return
@@ -43,7 +44,7 @@
                except Exception, e:
                        self.send_error(500)
                        self.end_headers()
-                       log.error("request_handler_server: exception: %s" % e)
+                       log.error("request_handler_server: [%s]: exception: %s" 
% (client_address[0], e))
                        raise
                        pass
 
@@ -55,10 +56,10 @@
                port = config.request_handler_server_port
 
                server = HTTPServer((host, port), MyHandler)
-               print 'started httpserver on :%d...' % port
+               log.notice('request_handler_server: started on [%s:%d]...' % 
(host, port))
                server.serve_forever()
        except KeyboardInterrupt:
-               print '^C received, shutting down server'
+               log.notice('request_handler_server: ^C received, shutting down 
server')
                server.socket.close()
 
 if __name__ == '__main__':
================================================================

---- CVS-web:
    
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/pld-builder.new/PLD_Builder/request_handler_server.py?r1=1.6&r2=1.7&f=u

_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to