code: def log_to_stderr(level=logging.INFO):
      """
      Set up the logging infrastructure to show log output on ``sys.stderr``, where it will
      appear in the IPython message log.
      """
      global _lts_initialized
      if _lts_initialized:
          _log.info("log already initialized")
  
      h = logging.StreamHandler(sys.stderr)
      f = logging.Formatter("[%(levelname)7s] %(name)s %(message)s")
      h.setFormatter(f)
      root = logging.getLogger()
      root.addHandler(h)
      root.setLevel(level)
  
      _log.info("stderr logging configured")
      _lts_initialized = True
  
file_path: lkpy/lenskit/util/log.py
imports: import sys
  import logging
  from logging.handlers import QueueListener
  import multiprocessing
label_desc: Use image node_id 1 for calling a global function with example usage: log_to_stderr(level) without return types