- self.logger = _SfaLogger(logfile='/var/log/sfa_import.log', loggername='importlog')
- self.logger.setLevelFromOptVerbose(self.config.SFA_API_LOGLEVEL)
- self.auth_hierarchy = Hierarchy ()
- self.TrustedRoots = TrustedRoots(self.config.get_trustedroots_dir())
-
+ if auth_hierarchy is not None:
+ self.auth_hierarchy = auth_hierarchy
+ else:
+ self.auth_hierarchy = Hierarchy()
+ if logger is not None:
+ self.logger = logger
+ else:
+ self.logger = _SfaLogger(
+ logfile='/var/log/sfa_import.log', loggername='importlog')
+ self.logger.setLevelFromOptVerbose(self.config.SFA_API_LOGLEVEL)
+# ugly side effect so that other modules get it right
+ import sfa.util.sfalogging
+ sfa.util.sfalogging.logger = logger
+# self.TrustedRoots = TrustedRoots(self.config.get_trustedroots_dir())
+