Changeset View
Changeset View
Standalone View
Standalone View
swh/vault/cli.py
Show All 14 Lines | |||||
@click.option('--log-level', '-l', default='INFO', | @click.option('--log-level', '-l', default='INFO', | ||||
type=click.Choice(logging._nameToLevel.keys()), | type=click.Choice(logging._nameToLevel.keys()), | ||||
help="Log level (default to INFO)") | help="Log level (default to INFO)") | ||||
@click.option('--no-stdout', is_flag=True, default=False, | @click.option('--no-stdout', is_flag=True, default=False, | ||||
help="Do NOT output logs on the console") | help="Do NOT output logs on the console") | ||||
@click.option('--host', default='0.0.0.0', help="Host to run the server") | @click.option('--host', default='0.0.0.0', help="Host to run the server") | ||||
@click.option('--port', default=5005, type=click.INT, | @click.option('--port', default=5005, type=click.INT, | ||||
help="Binding port of the server") | help="Binding port of the server") | ||||
@click.option('--debug/--nodebug', default=True, | @click.option('--debug/--no-debug', default=True, | ||||
help="Indicates if the server should run in debug mode") | help="Indicates if the server should run in debug mode") | ||||
@click.pass_context | @click.pass_context | ||||
def cli(ctx, config_file, log_level, no_stdout, host, port, debug): | def cli(ctx, config_file, log_level, no_stdout, host, port, debug): | ||||
"""Software Heritage Vault API server | """Software Heritage Vault API server | ||||
""" | """ | ||||
from swh.scheduler.celery_backend.config import setup_log_handler | from swh.scheduler.celery_backend.config import setup_log_handler | ||||
log_level = setup_log_handler( | log_level = setup_log_handler( | ||||
Show All 19 Lines |