parameters: (self, record)
docstring: Emit a record.
docstring_summary: Emit a record.
docstring_tokens: Emit a record .
function: def emit(self, record):
          """Emit a record."""
          try:
              stream = cherrypy.serving.request.wsgi_environ.get('wsgi.errors')
          except (AttributeError, KeyError):
              pass
          else:
              try:
                  msg = self.format(record)
                  fs = '%s\n'
                  import types
                  # if no unicode support...
                  if not hasattr(types, 'UnicodeType'):
                      stream.write(fs % msg)
                  else:
                      try:
                          stream.write(fs % msg)
                      except UnicodeError:
                          stream.write(fs % msg.encode('UTF-8'))
                  self.flush()
              except Exception:
                  self.handleError(record)
function_tokens: def emit ( self , record ) : try : stream = cherrypy . serving . request . wsgi_environ . get ( 'wsgi.errors' ) except ( AttributeError , KeyError ) : pass else : try : msg = self . format ( record ) fs = '%s\n' import types # if no unicode support... if not hasattr ( types , 'UnicodeType' ) : stream . write ( fs % msg ) else : try : stream . write ( fs % msg ) except UnicodeError : stream . write ( fs % msg . encode ( 'UTF-8' ) ) self . flush ( ) except Exception : self . handleError ( record )