Allow setting debug mode from command line

Adds a --debug option to the command-line that enables debug mode
when running the sushy-emulator.
This should simplify debugging and development.

Change-Id: Ibf420dc3324b00548f55e4efd8610a61ded10dd3
This commit is contained in:
Riccardo Pittau 2020-11-17 19:26:14 +01:00
parent 74318321aa
commit e7dbba93f1
2 changed files with 9 additions and 0 deletions

View File

@ -0,0 +1,5 @@
---
features:
- |
Adds an option --debug to enable debug mode when running sushy-emulator.

View File

@ -779,6 +779,8 @@ def parse_args():
type=str,
help='Config file path. Can also be set via '
'environment variable SUSHY_EMULATOR_CONFIG.')
parser.add_argument('--debug', action='store_true',
help='Enables debug mode when running sushy-emulator.')
parser.add_argument('-i', '--interface',
type=str,
help='IP address of the local interface to listen '
@ -819,6 +821,8 @@ def main():
args = parse_args()
app.debug = args.debug
if args.config:
app.config.from_pyfile(args.config)