def configure_sc_logging(use_syslog=False):
 log.setLevel(logging.DEBUG)
 formatter = logging.Formatter(DEBUG_FORMAT_PID)
 static.create_sc_config_dirs()
 rfh = logging.handlers.RotatingFileHandler(static.DEBUG_FILE, maxBytes=1048576, backupCount=2)
 rfh.setLevel(logging.DEBUG)
 rfh.setFormatter(formatter)
 log.addHandler(rfh)
 console.setLevel(logging.INFO)
 log.addHandler(console)
 syslog_device = '/dev/log'
 if (use_syslog and os.path.exists(syslog_device)):
  log.debug(('Logging to %s' % syslog_device))
  syslog_handler = logging.handlers.SysLogHandler(address=syslog_device)
  syslog_handler.setFormatter(formatter)
  syslog_handler.setLevel(logging.DEBUG)
  log.addHandler(syslog_handler)

def configure_sc_logging ( use_syslog = False ) : log . setLevel ( logging . DEBUG ) formatter = logging . Formatter ( DEBUG_FORMAT_PID ) static . create_sc_config_dirs ( ) rfh = logging . handlers . RotatingFileHandler ( static . DEBUG_FILE , maxBytes = 1048576 , backupCount = 2 ) rfh . setLevel ( logging . DEBUG ) rfh . setFormatter ( formatter ) log . addHandler ( rfh ) console . setLevel ( logging . INFO ) log . addHandler ( console ) syslog_device = '/dev/log' if ( use_syslog and os . path . exists ( syslog_device ) ) : log . debug ( ( 'Logging to %s' % syslog_device ) ) syslog_handler = logging . handlers . SysLogHandler ( address = syslog_device ) syslog_handler . setFormatter ( formatter ) syslog_handler . setLevel ( logging . DEBUG ) log . addHandler ( syslog_handler )
configure logging for starcluster *application* code by default starclusters logger has no formatters and a nullhandler so that other developers using starcluster as a library can configure logging as they see fit .