class_docstr: Log writer to write vdl records to log file.
  
  The class `LogWriter` provides APIs to create record file and add records to
  it. The class updates log file asynchronously without slowing down training.
class_docstr_tok: ["Log","writer","to","write","vdl","records","to","log","file",".","The","class","`","LogWriter","`","provides","APIs","to","create","record","file","and","add","records","to","it",".","The","class","updates","log","file","asynchronously","without","slowing","down","training","."]
docstr: Create a instance of class `LogWriter` and create a vdl log file with
  given args.
  
  Args:
      logdir (string): Directory of log file. Default is
          `runs/**current_time**.**comment**`.
      comment (string): Suffix appended to the default `logdir`.It has no
          effect if `logidr` is assigned.
      max_queue (int): Size of queue for pending records.
      flush_secs (int): The duration to flush the pending records in queue
          to disk.
      filename_suffix (string): Suffix added to vdl log file.
      write_to_disk (boolean): Write to disk if it is True.
code: def __init__(
      self,
      logdir=None,
      comment="",
      max_queue=10,
      flush_secs=120,
      filename_suffix="",
      write_to_disk=True,
      display_name="",
      file_name="",
      **kwargs,
  ):
      """Create a instance of class `LogWriter` and create a vdl log file with
      given args.
  
      Args:
          logdir (string): Directory of log file. Default is
              `runs/**current_time**.**comment**`.
          comment (string): Suffix appended to the default `logdir`.It has no
              effect if `logidr` is assigned.
          max_queue (int): Size of queue for pending records.
          flush_secs (int): The duration to flush the pending records in queue
              to disk.
          filename_suffix (string): Suffix added to vdl log file.
          write_to_disk (boolean): Write to disk if it is True.
      """
      if not logdir:
          from datetime import datetime
  
          current_time = datetime.now().strftime("%b%d_%H-%M-%S")
          if "" != comment:
              comment = "." + comment
          logdir = os.path.join("runs", current_time + comment)
      self._logdir = logdir
      self._max_queue = max_queue
      self._flush_secs = flush_secs
      self._filename_suffix = filename_suffix
      self._write_to_disk = write_to_disk
      self.kwargs = kwargs
      self._file_name = file_name
  
      self._file_writer = None
      self._all_writers = {}
      self._get_file_writer()
      self.loggers = {}
      self.add_meta(display_name=display_name)
  
imports: import os
  import time
  import numpy
  from visualdl.component.base_component import audio
  from visualdl.component.base_component import embedding
  from visualdl.component.base_component import histogram
  from visualdl.component.base_component import hparam
  from visualdl.component.base_component import image
  from visualdl.component.base_component import meta_data
  from visualdl.component.base_component import pr_curve
  from visualdl.component.base_component import roc_curve
  from visualdl.component.base_component import scalar
  from visualdl.component.base_component import scalars
  from visualdl.component.base_component import text
  from visualdl.component.graph import translate_graph
  from visualdl.io import bfile
  from visualdl.server.log import logger
  from visualdl.utils.figure_util import figure_to_image
  from visualdl.utils.img_util import merge_images
  from visualdl.utils.md5_util import md5
  from visualdl.writer.record_writer import RecordFileWriter
label_desc: Use image node_id 1 to create a new LogWriter object from inherited base classes: object with example: obj = LogWriter(logdir, comment, max_queue, flush_secs, filename_suffix, write_to_disk, display_name, file_name)