Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
version=gnocchi.__version__)
utils.parallel_map.MAX_WORKERS = conf.parallel_operations
if not log_to_std and (conf.log_dir or conf.log_file):
outputs = [daiquiri.output.File(filename=conf.log_file,
directory=conf.log_dir)]
else:
outputs = [daiquiri.output.STDERR]
if conf.use_syslog:
outputs.append(
daiquiri.output.Syslog(facility=conf.syslog_log_facility))
if conf.use_journal:
outputs.append(daiquiri.output.Journal())
daiquiri.setup(outputs=outputs)
if logging_level is None:
if conf.debug:
logging_level = logging.DEBUG
elif conf.verbose:
logging_level = logging.INFO
else:
logging_level = logging.WARNING
logging.getLogger("gnocchi").setLevel(logging_level)
# HACK(jd) I'm not happy about that, fix AP class to handle a conf object?
archive_policy.ArchivePolicy.DEFAULT_AGGREGATION_METHODS = (
conf.archive_policy.default_aggregation_methods
)
', '.join("'%s'" % fac
for fac in valid_facilities))
return getattr(syslog, facility)
preconfigured = {
'stderr': STDERR,
'stdout': STDOUT,
}
if syslog is not None:
preconfigured['syslog'] = Syslog()
if handlers.journal is not None:
preconfigured['journal'] = Journal()