class_docstr: Format the log message as a JSON object so that it can be later used/parsed in browser with javascript.
class_docstr_tok: ["Format","the","log","message","as","a","JSON","object","so","that","it","can","be","later","used\/parsed","in","browser","with","javascript","."]
docstr: Format the log message as a JSON object.
  
  :param record: A LogRecord object.
  :return:: LogRecord with JSON format.
docstr_tok: ["Format","the","log","message","as","a","JSON","object",".",":","param","record",":","A","LogRecord","object",".",":","return",":",":","LogRecord","with","JSON","format","."]
code: def format(self, record: "LogRecord"):
      """
      Format the log message as a JSON object.
  
      :param record: A LogRecord object.
      :return:: LogRecord with JSON format.
      """
      cr = copy(record)
      cr.msg = re.sub(r"\u001b\[.*?[@-~]", "", str(cr.msg))
      return json.dumps(
          {k: getattr(cr, k) for k in self.KEYS if hasattr(cr, k)},
          sort_keys=True,
      )
  
file_path: jina/jina/logging/formatter.py
imports: import json
  import re
  from copy import copy
  from logging import Formatter, LogRecord
label_desc: Use image node_id 1 for calling the JsonFormatter obj's underlying member method code with example usage: obj.format(record) and returns: json