Skip to content

Commit

Permalink
Nicer verbosity impl.
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelcaricio committed Sep 15, 2016
1 parent 08b20e5 commit 2d23ac9
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions connexion/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,7 @@ def validate_wsgi_server_requirements(ctx, param, value):
is_flag=True, default=False)
@click.option('--debug', '-d', help='Show debugging information.',
is_flag=True, default=False)
@click.option('--verbose', '-v', help='Show logging information.',
is_flag=True, default=False)
@click.option('--very-verbose', '-vv', help='Show debugging information, same as `--debug`.',
is_flag=True, default=False)
@click.option('--verbose', '-v', help='Show verbose information.', count=True)
def run(spec_file,
base_module_path,
port,
Expand All @@ -75,8 +72,7 @@ def run(spec_file,
validate_responses,
strict_validation,
debug,
verbose,
very_verbose):
verbose):
"""
Runs a server compliant with a OpenAPI/Swagger 2.0 Specification file.
Expand All @@ -87,10 +83,10 @@ def run(spec_file,
- BASE_MODULE_PATH (optional): filesystem path where the API endpoints handlers are going to be imported from.
"""
logging_level = logging.WARN
if verbose:
if verbose > 0:
logging_level = logging.INFO

if debug or very_verbose:
if debug or verbose > 1:
logging_level = logging.DEBUG
debug = True

Expand Down

0 comments on commit 2d23ac9

Please sign in to comment.