parameters: (self, record)
docstring: Emit a record.
  
          Send the record to the Web server as a percent-encoded dictionary
docstring_summary: Emit a record.
docstring_tokens: Emit a record .
function: def emit(self, record):
          """
          Emit a record.
  
          Send the record to the Web server as a percent-encoded dictionary
          """
          try:
              import httplib, urllib
              host = self.host
              h = httplib.HTTP(host)
              url = self.url
              data = urllib.urlencode(self.mapLogRecord(record))
              if self.method == "GET":
                  if (url.find('?') >= 0):
                      sep = '&'
                  else:
                      sep = '?'
                  url = url + "%c%s" % (sep, data)
              h.putrequest(self.method, url)
              # support multiple hosts on one IP address...
              # need to strip optional :port from host, if present
              i = host.find(":")
              if i >= 0:
                  host = host[:i]
              h.putheader("Host", host)
              if self.method == "POST":
                  h.putheader("Content-type",
                              "application/x-www-form-urlencoded")
                  h.putheader("Content-length", str(len(data)))
              h.endheaders(data if self.method == "POST" else None)
              h.getreply()    #can't do anything with the result
          except (KeyboardInterrupt, SystemExit):
              raise
          except:
              self.handleError(record)
function_tokens: def emit ( self , record ) : try : import httplib , urllib host = self . host h = httplib . HTTP ( host ) url = self . url data = urllib . urlencode ( self . mapLogRecord ( record ) ) if self . method == "GET" : if ( url . find ( '?' ) >= 0 ) : sep = '&' else : sep = '?' url = url + "%c%s" % ( sep , data ) h . putrequest ( self . method , url ) # support multiple hosts on one IP address... # need to strip optional :port from host, if present i = host . find ( ":" ) if i >= 0 : host = host [ : i ] h . putheader ( "Host" , host ) if self . method == "POST" : h . putheader ( "Content-type" , "application/x-www-form-urlencoded" ) h . putheader ( "Content-length" , str ( len ( data ) ) ) h . endheaders ( data if self . method == "POST" else None ) h . getreply ( ) #can't do anything with the result except ( KeyboardInterrupt , SystemExit ) : raise except : self . handleError ( record )