class_docstr: Main logging handler used by :class:`~pyro.infer.mcmc`,
  to handle both progress bar updates and regular `logging`
  messages.
  
  :param log_handler: default log handler for logging
      output.
  :param progress_bar: If provided, diagnostic information
      is updated using the bar.
class_docstr_tok: ["Main","logging","handler","used","by",":","class",":","`","~pyro.infer.mcmc","`",",","to","handle","both","progress","bar","updates","and","regular","`","logging","`","messages",".",":","param","log_handler",":","default","log","handler","for","logging","output",".",":","param","progress_bar",":","If","provided",",","diagnostic","information","is","updated","using","the","bar","."]
code: def emit(self, record):
      try:
          if self.progress_bar and record.msg_type == DIAGNOSTIC_MSG:
              diagnostics = json.loads(
                  record.getMessage(), object_pairs_hook=OrderedDict
              )
              self.progress_bar.set_postfix(diagnostics, refresh=False)
              self.progress_bar.update()
          else:
              self.log_handler.handle(record)
      except (KeyboardInterrupt, SystemExit):
          raise
      except Exception:
          self.handleError(record)
  
imports: import json
  import logging
  import os
  import sys
  from collections import OrderedDict
  from tqdm import tqdm
  from tqdm.auto import tqdm
label_desc: Use image node_id 2 for calling the MCMCLoggingHandler obj's underlying member method code with example usage: obj.emit(record) without return types