コード例 #1
0
ファイル: Config.py プロジェクト: BackupGGCode/bsdradius
	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()
コード例 #2
0
    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()
コード例 #3
0
ファイル: bsdradiusd.py プロジェクト: BackupGGCode/bsdradius
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 ---')
コード例 #4
0
ファイル: bsdradiusd.py プロジェクト: ikelos/bsdradius
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: