code: def get_base_logger(
      cls, level=None, stream=sys.stdout, colored=False
  ):
      if LoggerRoot.__base_logger:
          return LoggerRoot.__base_logger
  
      # Note we can't use LOG_LEVEL_ENV_VAR defined in clearml.config.defs due to a circular dependency
      if level is None and getenv("CLEARML_LOG_LEVEL"):
          level = resolve_logging_level(
              getenv("CLEARML_LOG_LEVEL").strip()
          )
          if level is None:
              print(
                  "Invalid value in environment variable CLEARML_LOG_LEVEL: %s"
                  % getenv("CLEARML_LOG_LEVEL")
              )
  
      clearml_logger = logging.getLogger("clearml")
  
      if level is None:
          level = clearml_logger.level
  
      # avoid nested imports
      from ..config import get_log_redirect_level
  
      LoggerRoot.__base_logger = PickledLogger.wrapper(
          clearml_logger,
          func=cls.get_base_logger,
          level=level,
          stream=stream,
          colored=colored,
      )
  
      LoggerRoot.__base_logger.setLevel(level)
  
      redirect_level = get_log_redirect_level()
  
      # Do not redirect to stderr if the target stream is already stderr
      if redirect_level is not None and stream not in (
          None,
          sys.stderr,
      ):
          # Adjust redirect level in case requested level is higher (e.g. logger is requested for CRITICAL
          # and redirect is set for ERROR, in which case we redirect from CRITICAL)
          redirect_level = max(level, redirect_level)
          LoggerRoot.__base_logger.addHandler(
              ClearmlStreamHandler(redirect_level, sys.stderr, colored)
          )
  
          if level < redirect_level:
              # Not all levels were redirected, remaining should be sent to requested stream
              handler = ClearmlStreamHandler(level, stream, colored)
              handler.addFilter(
                  _LevelRangeFilter(
                      min_level=level, max_level=redirect_level - 1
                  )
              )
              LoggerRoot.__base_logger.addHandler(handler)
      else:
          LoggerRoot.__base_logger.addHandler(
              ClearmlStreamHandler(level, stream, colored)
          )
  
      LoggerRoot.__base_logger.propagate = False
      return LoggerRoot.__base_logger
  
imports: import inspect
  import logging
  import logging.handlers
  import os
  import sys
  from os import getenv
  from platform import system
  from typing import Optional, Union
  from pathlib2 import Path
  from six import BytesIO
label_desc: Use image node_id 1 for calling the LoggerRoot obj's underlying member method code with example usage: obj.get_base_logger(cls, level, stream, colored) and returns: LoggerRoot, LoggerRoot