parameters: (self)
docstring: Sends the last n lines from logbuf, or all of it if n is not set
docstring_summary: Sends the last n lines from logbuf, or all of it if n is not set
docstring_tokens: Sends the last n lines from logbuf or all of it if n is not set
function: def get(self):
      """ Sends the last n lines from logbuf, or all of it if n is not set """
      n = self.get_argument("n", default=None)
      try:
        timeformat = "%FT%T.%f%z"
        if logbuf[0].dt.tzname() == "UTC":
          timeformat = "%FT%T.%fZ"
      except IndexError:
        pass  # don't care, logbuf is probably empty
  
      env = { "timeformat": timeformat,
              "logbuf": list(logbuf)[-int(n):] if n else logbuf
            }
      out = jinja2.Environment().from_string(LOGS_MLDB_TEMPLATE).render(**env)
      self.set_header('Content-Type', 'text/html')
      self.write(out)
function_tokens: def get ( self ) : n = self . get_argument ( "n" , default = None ) try : timeformat = "%FT%T.%f%z" if logbuf [ 0 ] . dt . tzname ( ) == "UTC" : timeformat = "%FT%T.%fZ" except IndexError : pass # don't care, logbuf is probably empty env = { "timeformat" : timeformat , "logbuf" : list ( logbuf ) [ - int ( n ) : ] if n else logbuf } out = jinja2 . Environment ( ) . from_string ( LOGS_MLDB_TEMPLATE ) . render ( * * env ) self . set_header ( 'Content-Type' , 'text/html' ) self . write ( out )