def applyConfig(self): """Apply configuration """ # apply options if self['SERVER']['debug_mode']: self['SERVER']['foreground'] = True self['SERVER']['no_threads'] = True self['SERVER']['log_to_screen'] = True if self['SERVER']['log_to_screen']: self['SERVER']['log_to_file'] = False logger.logToScreen = True logger.createOutputHandlers() if self['SERVER']['log_client']: # restrict all threads from logger info ('--- Enabling threads logging restrictions ---') logger.restrictThreads = True # add this (main) thread to unrestricted threads to allow print log messages logger.addUnrestrictedThread()
def applyConfig(self): """Apply configuration """ # apply options if self['SERVER']['debug_mode']: self['SERVER']['foreground'] = True self['SERVER']['no_threads'] = True self['SERVER']['log_to_screen'] = True if self['SERVER']['log_to_screen']: self['SERVER']['log_to_file'] = False logger.logToScreen = True logger.createOutputHandlers() if self['SERVER']['log_client']: # restrict all threads from logger info('--- Enabling threads logging restrictions ---') logger.restrictThreads = True # add this (main) thread to unrestricted threads to allow print log messages logger.addUnrestrictedThread()
from bsdradius import misc from bsdradius import modules from bsdradius import Config from bsdradius.pyrad import dictionary from bsdradius.ConfigDb import ConfigDb from bsdradius.configDefaults import defaultOptions, defaultTypes from bsdradius.logger import * # set logging defaults logger.showDebug = True logger.showErrors = True logger.showWarning = True logger.showInfo = True logger.logToScreen = False logger.createOutputHandlers() def main(): """Prepare and execute server """ # make sure that keyboard interrupt stops our server # and clean up before exiting signal.signal(signal.SIGINT, misc.killSignalHandler) signal.signal(signal.SIGTERM, misc.killSignalHandler) # try: # import psyco # psyco.full() # print ('--- Running psyco ---')
from bsdradius import DatabaseConnection from bsdradius import misc from bsdradius import modules from bsdradius import Config from bsdradius.pyrad import dictionary from bsdradius.ConfigDb import ConfigDb from bsdradius.configDefaults import defaultOptions, defaultTypes from bsdradius.logger import * # set logging defaults logger.showDebug = True logger.showErrors = True logger.showWarning = True logger.showInfo = True logger.logToScreen = False logger.createOutputHandlers() def main(): """Prepare and execute server """ # make sure that keyboard interrupt stops our server # and clean up before exiting signal.signal(signal.SIGINT, misc.killSignalHandler) signal.signal(signal.SIGTERM, misc.killSignalHandler) # try: # import psyco # psyco.full() # print ('--- Running psyco ---') # except: