code: def setup_logger(log_file, level=logging.DEBUG):
      '''One function call to set up logging with some nice logs about the machine'''
      cfg = AppBuilder.get_pcfg()
      logger = cfg['log_module']
      # todo make sure structlog is compliant and that logbook is also the correct name???
      assert logger in ("logging", "logbook", "structlog"), 'bad logger specified'
      exec("import {0};logging = {0}".format(logger))
  
      AppBuilder.logger = logging
  
      logging.basicConfig(
          filename=log_file,
          filemode='w',
          level=level,
          format='%(asctime)s:%(levelname)s: %(message)s')  # one run
      logging.debug('System is: %s' % platform.platform())
      logging.debug('Python archetecture is: %s' % platform.architecture()[0])
      logging.debug('Machine archetecture is: %s' % platform.machine())
  
      set_windows_permissions(log_filef setup_logger(log_file, level=logging.DEBUG):
      '''One function call to set up logging with some nice logs about the machine'''
      cfg = AppBuilder.get_pcfg()
      logger = cfg['log_module']
      # todo make sure structlog is compliant and that logbook is also the correct name???
      assert logger in ("logging", "logbook", "structlog"), 'bad logger specified'
      exec("import {0};logging = {0}".format(logger))
  
      AppBuilder.logger = logging
  
      logging.basicConfig(
          filename=log_file,
          filemode='w',
          level=level,
          format='%(asctime)s:%(levelname)s: %(message)s')  # one run
      logging.debug('System is: %s' % platform.platform())
      logging.debug('Python archetecture is: %s' % platform.architecture()[0])
      logging.debug('Machine archetecture is: %s' % platform.machine())
  
      set_windows_permissions(log_file)
docs: One function call to set up logging with some nice logs about the machine