set loglevel even if in production

This commit is contained in:
Maxime Alves LIRMM@home 2021-10-12 03:10:10 +02:00
parent c99e636d6e
commit 5a0509a114
1 changed files with 8 additions and 1 deletions

View File

@ -33,7 +33,7 @@ def run(host, port, reload):
reload = False
raise Exception('Can\'t use live code reload in production')
log_level = 'info' if PRODUCTION else LOGLEVEL
log_level = LOGLEVEL or 'info'
click.echo(f'Launching application {PROJECT_NAME}')
@ -41,6 +41,13 @@ def run(host, port, reload):
list_api_routes()
click.echo(f'uvicorn.run("halfapi.app:application"\n' \
f'host: {host}\n' \
f'port: {port}\n' \
f'log_level: {log_level}\n' \
f'reload: {reload}\n'
)
uvicorn.run('halfapi.app:application',
host=host,
port=int(port),