Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def cli(ctx: click.Context, verbose: bool = False,
no_version_check: bool = False, change_dir: str = None,
no_log_file: bool = False, log_file: str = "chaostoolkit.log",
log_format: str = "string", settings: str = CHAOSTOOLKIT_CONFIG_PATH):
if no_log_file:
configure_logger(
verbose=verbose, log_format=log_format,
context_id=str(uuid.uuid4()))
else:
configure_logger(
verbose=verbose, log_file=log_file, log_format=log_format,
context_id=str(uuid.uuid4()))
subcommand = ctx.invoked_subcommand
# make it nicer for going through the log file
logger.debug("#" * 79)
logger.debug("Running command '{}'".format(subcommand))
ctx.obj = {}
ctx.obj["settings_path"] = click.format_filename(settings)
logger.debug("Using settings file '{}'".format(ctx.obj["settings_path"]))
if not no_version_check:
check_newer_version(command=subcommand)
def cli(ctx: click.Context, verbose: bool = False,
no_version_check: bool = False, change_dir: str = None,
no_log_file: bool = False, log_file: str = "chaostoolkit.log",
log_format: str = "string", settings: str = CHAOSTOOLKIT_CONFIG_PATH):
if no_log_file:
configure_logger(
verbose=verbose, log_format=log_format,
context_id=str(uuid.uuid4()))
else:
configure_logger(
verbose=verbose, log_file=log_file, log_format=log_format,
context_id=str(uuid.uuid4()))
subcommand = ctx.invoked_subcommand
# make it nicer for going through the log file
logger.debug("#" * 79)
logger.debug("Running command '{}'".format(subcommand))
ctx.obj = {}
ctx.obj["settings_path"] = click.format_filename(settings)
logger.debug("Using settings file '{}'".format(ctx.obj["settings_path"]))