def configureCE(self, CELogger_LOGFILE='conflict_error_test.log', CELogger_FIRST_CHANGE_ONLY=True, CELogger_RAISE_CONFLICTERRORPREVIEW=False, CELogger_ACTIVE=True): """ configure ClinflictErrorLooger """ self.logfile = os.path.join(self.testdir, CELogger_LOGFILE) self.logCE = do_enable(self.logfile) self.logCE.level = logging.DEBUG conflictLogger.config( log=self.logCE, FIRST_CHANGE_ONLY=CELogger_FIRST_CHANGE_ONLY, RAISE_CONFLICTERRORPREVIEW=CELogger_RAISE_CONFLICTERRORPREVIEW)
def AlreadyApplied(patch): if patch in _enabled: return True _enabled.append(patch) return False if not AlreadyApplied('ConflictLogger.__init__'): ACTIVE = os.environ.get('CELogger_ACTIVE', True) LOGFILE = os.environ.get('CELogger_LOGFILE', '') FIRST_CHANGE_ONLY = os.environ.get('CELogger_FIRST_CHANGE_ONLY', True) RAISE_CONFLICTERRORPREVIEW = os.environ.get( 'CELogger_RAISE_CONFLICTERRORPREVIEW', False) if LOGFILE: log = do_enable(LOGFILE) else: log = logging.getLogger("CELogger") config = getConfiguration() if not config.debug_mode: log.critical("Attention: You are not running in debug-mode. " "Do not use Products.ConflictErrorLogger for " "Productive systems!") if (not LOGFILE) and (log.level > logging.WARNING): log.critical("Set the 'LOG_LEVEL' to 'WARNING' or use the " "'CELogger_LOGFILE' option in order to get the messages " "properly") log.warning("Please, be warned that 'Products.ConflictErrorLogger' will " "not work properly with more than 1 instance (ZEO).")