class_docstr: DeepPavlov dialog logging facility.
  
  DialogLogger is an entity which provides tools for dialogs logging.
  
  Args:
      enabled: DialogLogger on/off flag.
      logger_name: Dialog logger name that is used for organising log files.
  
  Attributes:
      logger_name: Dialog logger name which is used for organising log files.
      log_max_size: Maximum size of log file, kb.
      self.log_file: Current log file object.
class_docstr_tok: ["DeepPavlov","dialog","logging","facility",".","DialogLogger","is","an","entity","which","provides","tools","for","dialogs","logging",".","Args",":","enabled",":","DialogLogger","on\/off","flag",".","logger_name",":","Dialog","logger","name","that","is","used","for","organising","log","files",".","Attributes",":","logger_name",":","Dialog","logger","name","which","is","used","for","organising","log","files",".","log_max_size",":","Maximum","size","of","log","file",",","kb",".","self.log_file",":","Current","log","file","object","."]
docstr: Logs single dialog utterance to current dialog log file.
  
  Args:
      utterance: Dialog utterance.
      direction: 'in' or 'out' utterance direction.
      dialog_id: Dialog ID.
docstr_tok: ["Logs","single","dialog","utterance","to","current","dialog","log","file",".","Args",":","utterance",":","Dialog","utterance",".","direction",":","'in","'","or","'out","'","utterance","direction",".","dialog_id",":","Dialog","ID","."]
code: def _log(
      self,
      utterance: Any,
      direction: str,
      dialog_id: Optional[Hashable] = None,
  ):
      """Logs single dialog utterance to current dialog log file.
  
      Args:
          utterance: Dialog utterance.
          direction: 'in' or 'out' utterance direction.
          dialog_id: Dialog ID.
      """
      if isinstance(utterance, str):
          pass
      elif isinstance(utterance, (list, dict)):
          utterance = jsonify_data(utterance)
      else:
          utterance = str(utterance)
  
      dialog_id = (
          str(dialog_id)
          if not isinstance(dialog_id, str)
          else dialog_id
      )
  
      if self.log_file.tell() >= self.log_max_size * 1024:
          self.log_file.close()
          self.log_file = self._get_log_file()
      else:
          try:
              log_msg = {}
              log_msg["timestamp"] = self._get_timestamp_utc_str()
              log_msg["dialog_id"] = dialog_id
              log_msg["direction"] = direction
              log_msg["message"] = utterance
              log_str = json.dumps(
                  log_msg, ensure_ascii=self.config["ensure_ascii"]
              )
              self.log_file.write(f"{log_str}\n")
          except IOError:
              log.error("Failed to write dialog log.")
  
file_path: DeepPavlov/deeppavlov/utils/connector/dialog_logger.py
imports: import json
  from datetime import datetime
  from logging import getLogger
  from pathlib import Path
  from typing import Any, Optional, Hashable
  from deeppavlov.core.common.file import read_json
  from deeppavlov.core.common.paths import get_settings_path
  from deeppavlov.core.data.utils import jsonify_data
label_desc: Use image node_id 4 for calling the DialogLogger obj's underlying member method code with example usage: obj._log(utterance, direction, dialog_id) without return types