Skip to content

Commit

Permalink
Add -log flag to scitt-emulator server
Browse files Browse the repository at this point in the history
Signed-off-by: John Andersen <[email protected]>
  • Loading branch information
pdxjohnny committed Oct 23, 2023
1 parent f39ec18 commit ab88d04
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions scitt_emulator/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from pathlib import Path
from io import BytesIO
import random
import logging

from quart import Quart, request, send_file, make_response
from blinker import Namespace
Expand Down Expand Up @@ -126,6 +127,7 @@ async def get_operation(operation_id: str):
def cli(fn):
parser = fn()
parser.add_argument("-p", "--port", type=int, default=8000)
parser.add_argument("--log", type=str, default="INFO")
parser.add_argument("--error-rate", type=float, default=0.01)
parser.add_argument("--use-lro", action="store_true", help="Create operations for submissions")
parser.add_argument("--tree-alg", required=True, choices=list(TREE_ALGS.keys()))
Expand All @@ -139,6 +141,7 @@ def cli(fn):
parser.add_argument("--middleware-config-path", type=Path, nargs="*", default=[])

def cmd(args):
logging.basicConfig(level=getattr(logging, args.log.upper(), "INFO"))
app = create_flask_app(
{
"port": args.port,
Expand Down

0 comments on commit ab88d04

Please sign in to comment.