Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
conf(args, project='gnocchi', validate_default_values=True,
default_config_files=default_config_files,
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 = (
def __init__(self, program_name=None, facility="user",
formatter=formatter.TEXT_FORMATTER, level=None):
if syslog is None:
# FIXME(jd) raise something more specific
raise RuntimeError("syslog is not available on this platform")
super(Syslog, self).__init__(
handlers.SyslogHandler(
program_name=program_name or get_program_name(),
facility=self._find_facility(facility)),
formatter, level)