Exemplo n.º 1
0
 def loggingInit(self):
     """Initializes logging at the beginning of the execution of the backup
     process.
     
     """
     if self._help is None:
         logmgr.setContext('STARTUP', self._globalConf.get('dry_run', False))
     else:
         logmgr.setContext('HELP')
     level = logmgr.getLogLevel(self._globalConf['console_loglevel'])
     logmgr.configConsole(level)
     if self._help is None:
         logger.info("Start Execution of Backup Jobs.")
Exemplo n.º 2
0
 def loggingConfig(self):
     """Configures logging depending on the settings from configuration
     files and command line options.
     
     """
     console_level = logmgr.getLogLevel(self._globalConf['console_loglevel'])
     if console_level is None:
         raise errors.BackupFatalConfigError("Invalid log level set in "
                                             "configuration file for option: "
                                             "console_loglevel")
     logfile_level = logmgr.getLogLevel(self._globalConf['logfile_loglevel'])  
     if logfile_level is None:
         raise errors.BackupFatalConfigError("Invalid log level set in "
                                             "configuration file for option: "
                                             "logfile_loglevel")
     logmgr.configConsole(console_level)
     backup_path = self._globalConf['backup_path']
     self.createBaseDir()
     filename_logfile = self._globalConf['filename_logfile']
     log_path = os.path.join(backup_path, filename_logfile)
     logmgr.configLogFile(logfile_level, log_path)
     logger.debug("Activated logging to file: %s" % log_path)