class_docstr: Towhee logger config.
  
  Args:
      mode (`Optional[str]`):
          The mode of Logger, decide which Handler to use, 'file' or 'console', defaults to 'console'.
      rotate_mode (`optional[str]`):
          The mode of rotating files, 'time' or 'size', defaults to 'time'.
      filename (`Optional[str]`):
          Path for log files, defaults to 'towhee.log'.
      rotate_when (`Optional[str]`):
          The type of TimedRotatingFileHandler interval, supports 'S', 'M', 'H', 'D', 'W0'-'W6', 'midnight', deafults to 'D'.
      rotate_interval (`Optional[int]`):
          The interval value of timed rotating, defaults to 1.
      backup_count (`Optional[int]`):
          The number of log files to keep, defaults to 10.
      stream_level (`Optional[str]`):
          The log level in console mode, defaults to 'WARNING'.
      file_level (`Optional[str]`):
          The log level in file mode, defautls to 'INFO'.
      utc (`Optional[bool]`):
          Whether to use utc time, defaults to False.
      stream (`Optional[Any]`):
          The stream to write logs into in console mode, defeaults to None and sys.stderr is used.
code: def rotate_mode_range(
      cls, rotate_mode
  ):  # pylint: disable=no-self-argument
      if rotate_mode not in ["time", "size"]:
          raise ValueError(
              f"value should be either 'time' or 'size', not '{rotate_mode}'."
          )
      return rotate_mode
  
imports: from typing import Optional, Any
  from pydantic import BaseModel, validator
  from towhee.utils.singleton import singleton
label_desc: Use image node_id 2 for calling the LogConfig obj's underlying member method code with example usage: obj.rotate_mode_range(cls, rotate_mode) and returns: rotate_mode