code: def emit(self, record: logging.LogRecord):
          
          created = datetime.datetime.fromtimestamp(record.created, timezone)
          obj = {
              "level": record.levelname.lower(),
              "msg": record.msg % record.args,
              "source": "%s:%d" % (record.filename, record.lineno),
              "time": format_datetime(created),
              "thread": reduce_thread_id(record.thread),
          }
          if record.exc_info is not None:
              obj["error"] = traceback.format_exception(*record.exc_info)[1:]
          try:
              obj["context"] = self.local.context
          except AttributeError:
              pass
          json.dump(obj, sys.stdout, sort_keys=True)
          sys.stdout.write("\n")
          sys.stdout.flush()
docs: Print the log record formatted as JSON to stdout.