class_docstr: The base Application for ipyparallel apps
  
  Primary extensions to BaseIPythonApplication:
  
  * work_dir
  * remote logging via pyzmq
  * IOLoop instance
code: def reinit_logging(self):
      # Remove old log files
      log_dir = self.profile_dir.log_dir
      if self.clean_logs:
          for f in os.listdir(log_dir):
              if re.match(r"%s-\d+\.(log|err|out)" % self.name, f):
                  try:
                      os.remove(os.path.join(log_dir, f))
                  except OSError:
                      # probably just conflict from sibling process
                      # already removing it
                      pass
      if self.log_to_file:
          # Start logging to the new log file
          log_filename = (
              f"{self.name}-{self.cluster_id}-{os.getpid()}.log"
          )
          logfile = os.path.join(log_dir, log_filename)
          if sys.__stderr__:
              print(f"Sending logs to {logfile}", file=sys.__stderr__)
          open_log_file = open(logfile, "w")
      else:
          open_log_file = None
      if open_log_file is not None:
          while self.log.handlers:
              self.log.removeHandler(self.log.handlers[0])
          self._log_handler = logging.StreamHandler(open_log_file)
          self.log.addHandler(self._log_handler)
      else:
          self._log_handler = self.log.handlers[0]
      # Add timestamps to log format:
      self._log_formatter = LevelFormatter(
          self.log_format, datefmt=self.log_datefmt
      )
      self._log_handler.setFormatter(self._log_formatter)
      # do not propagate log messages to root logger
      # ipcluster app will sometimes print duplicate messages during shutdown
      # if this is 1 (default):
      self.log.propagate = False
  
imports: import logging
  import os
  import re
  import sys
  import traitlets
  from IPython.core.application import BaseIPythonApplication
  from IPython.core.application import base_aliases
  from IPython.core.application import base_flags
  from IPython.utils.path import expand_path
  from jupyter_client.session import Session
  from tornado.ioloop import IOLoop
  from traitlets import Bool, Instance, Unicode, default, observe
  from traitlets.config.application import LevelFormatter, catch_config_error
  from .._version import __version__
label_desc: Use image node_id 11 for calling the BaseParallelApplication obj's underlying member method code with example usage: obj.reinit_logging() without return types