code: def get_logger(path=None, level=None, stream=None, colored=False):
      """Get a python logging object named using the provided filename and preconfigured with a color-formatted
      stream handler
      """
      # noinspection PyBroadException
      try:
          path = path or os.path.abspath((inspect.stack()[1])[1])
      except BaseException:
          # if for some reason we could not find the calling file, use our own
          path = os.path.abspath(__file__)
      root_log = LoggerRoot.get_base_logger(
          stream=sys.stdout, colored=colored
      )
      log = root_log.getChild(Path(path).stem)
      if level is not None:
          log.setLevel(level)
      if stream:
          ch = ClearmlStreamHandler(
              stream=stream, dont_set_formater=True
          )
          if level is not None:
              ch.setLevel(level)
          log.addHandler(ch)
      log.propagate = True
      return PickledLogger.wrapper(
          log,
          func=get_logger,
          path=path,
          level=level,
          stream=stream,
          colored=colored,
      )
  
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 4 for calling a global function with example usage: get_logger(path, level, stream, colored) and returns: PickledLogger