import logging class NullHandler(logging.Handler): def emit(self, record): pass log = logging.getLogger('App') log.setLevel(logging.ERROR) log.addHandler(NullHandler()) # global AppUtils.configureLogging() #============================ defines ========================================= GUI_UPDATEPERIOD = 250 # in ms DEPTH_RATE_CALCULATOR = 30 # columns names COL_PKGEN_NUM = 'num. pkgen' COL_PKGEN_PPS = 'pk./sec' COL_PKGEN_CLR = 'clear pkgen' COL_PKGEN_RATE = 'pkgen (num/rate/size)' #============================ body ============================================ ##
''' class NullHandler(logging.Handler): def emit(self, record): pass log = logging.getLogger('App') log.setLevel(logging.ERROR) log.addHandler(NullHandler()) ''' #============================ defines ========================================= #============================ globals ========================================= #============================ setup/teardown ================================== ''' def setup_module(function): # setup logging for loggerName in LOG_MODULES: temp = logging.getLogger(loggerName) temp.setLevel(logging.DEBUG) temp.addHandler(logHandler) # global AppUtils.configureLogging() ''' # activity logs (do last) activitylog = logging.getLogger('activitylog')
#============================ logging ========================================= # local import logging class NullHandler(logging.Handler): def emit(self, record): pass log = logging.getLogger('App') log.setLevel(logging.ERROR) log.addHandler(NullHandler()) # global AppUtils.configureLogging() #============================ defines ========================================= ## UDP port for all communication with this application SYNCTEMP_UDP_PORT = 0xf0ba ## Magic value put at the start of each packet SYNCTEMP_MAGIC_VALUE = [0x73,0x79,0x74,0x70] ## name of the file, in the local directory, where the configuration is stored CONFIG_FILENAME = 'configuration_DO_NOT_DELETE.txt' ## number of seconds before this application broadcasts the configuration to # the motes for the first time CONFIGURATION_PERIOD_INITIAL = 5
# local ''' class NullHandler(logging.Handler): def emit(self, record): pass log = logging.getLogger('App') log.setLevel(logging.ERROR) log.addHandler(NullHandler()) ''' #============================ defines ========================================= #============================ globals ========================================= #============================ setup/teardown ================================== ''' def setup_module(function): # setup logging for loggerName in LOG_MODULES: temp = logging.getLogger(loggerName) temp.setLevel(logging.DEBUG) temp.addHandler(logHandler) # global AppUtils.configureLogging() ''' # activity logs (do last) activitylog = logging.getLogger('activitylog')