#!/usr/bin/env python

import SocketServer
from SimpleXMLRPCServer import SimpleXMLRPCDispatcher , SimpleXMLRPCRequestHandler

class SocketXMLRPCRequestHandler(SimpleXMLRPCRequestHandler):
	def log_request(self, code='-', size='-'):
		"""Log an accepted request.  Parent class method vomits on UNIX sockets. """
# 		logging.getLogger("interfaceserver").debug("Acepted request: %s", self.requestline)
	
	def log_error(self, *args):
		"""Log an error.  Parent class method vomits on UNIX sockets. """
# 		logging.getLogger("interfaceserver").error("Request error: %s", str(args))

class SocketXMLRPCServer(SocketServer.UnixStreamServer, SimpleXMLRPCDispatcher):

	def __init__(self,socketaddr,requestHandler=SocketXMLRPCRequestHandler,logRequests=1):
		self.logRequests = logRequests
		SimpleXMLRPCDispatcher.__init__(self)
		SocketServer.UnixStreamServer.__init__(self,socketaddr,requestHandler)
