code: def setup(cls,
                opts=type('opts', (), {
                    'background': None,
                    'logdir': None,
                    'logging_conf_file': None,
                    'log_level': 'DEBUG'
                })):
          
          logger = logging.getLogger('luigi')
  
          if cls._configured:
              logger.info('logging already configured')
              return False
          cls._configured = True
  
          if cls.config.getboolean('core', 'no_configure_logging', False):
              logger.info('logging disabled in settings')
              return False
  
          configured = cls._cli(opts)
          if configured:
              logger = logging.getLogger('luigi')
              logger.info('logging configured via special settings')
              return True
  
          configured = cls._conf(opts)
          if configured:
              logger = logging.getLogger('luigi')
              logger.info('logging configured via *.conf file')
              return True
  
          configured = cls._section(opts)
          if configured:
              logger = logging.getLogger('luigi')
              logger.info('logging configured via config section')
              return True
  
          configured = cls._default(opts)
          if configured:
              logger = logging.getLogger('luigi')
              logger.info('logging configured by default settings')
          return configured
docs: Setup logging via CLI params and config.