def _lock(self,additional):
     if __debug__:
         util.lock_log(
             'Acquire lock in notificaiton map ' + str(self._mutex) + ' ' + additional)
     self._mutex.acquire()
     if __debug__:
         util.lock_log('Has acquired lock in notificaiton map ' + str(self._mutex) + ' ' + additional)
     pass
Exemple #2
0
def _setup_logging():
    '''
    Internal function.  Not to be used by programmer.
    '''
    DEFAULT_LOG_FILENAME = 'log.txt'
    DEFAULT_LOGGING_LEVEL = logging.CRITICAL
    
    format_ = (
        '%(levelname)s : %(asctime)s.%(msecs)f: %(endpoint_string)s : %(mod)s \n     %(message)s')
        # '%(levelname)s : %(asctime)s.%(msecs).03d: %(endpoint_string)s : %(mod)s \n     %(message)s')
    logging.basicConfig(
        format=format_, filename=DEFAULT_LOG_FILENAME, level=DEFAULT_LOGGING_LEVEL,
        datefmt='%I:%M:%S')

    util.get_logger().critical(
        '***** New *****', extra={'mod': 'NEW', 'endpoint_string': 'NEW'})

    util.lock_log('***** New *****')
 def _unlock(self):
     self.mutex.release()
     if __debug__:
         util.lock_log('Released in deadlock detector ' + str(self.mutex))
 def _lock(self):
     if __debug__:
         util.lock_log('Acquire in deadlock detector ' + str(self.mutex))
     self.mutex.acquire()
     if __debug__:
         util.lock_log('Has acquired in deadlock detector ' + str(self.mutex))
 def _unlock(self,additional):
     self._mutex.release()
     if __debug__:
         util.lock_log('Released lock in notificaiton map ' + str(self._mutex) + ' ' + additional)
         
     pass