Skip to content

Commit

Permalink
Simpler logging
Browse files Browse the repository at this point in the history
  • Loading branch information
Koen Bok committed Sep 18, 2012
1 parent 5230160 commit df43fbd
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions cactus/server.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import os
import sys

import SimpleHTTPServer
import SocketServer

Expand All @@ -18,3 +21,14 @@ def send_error(self, code, message=None):

return SimpleHTTPServer.SimpleHTTPRequestHandler.send_error(
self, code, message=None)

def log_message(self, format, *args):
sys.stdout.write("%s\n" % format%args)

def log_request(self, code='', size=''):
try:
self.log_message('%s %s %s', str(code),
self.requestline.split(' ')[0],
self.requestline.split(' ')[1])
except:
pass

0 comments on commit df43fbd

Please sign in to comment.