Skip to content

Commit

Permalink
Merge pull request fkie-cad#111 from fkie-cad/uaas-log-level
Browse files Browse the repository at this point in the history
added customizable log level for uaas server entrypoint
dorpvom authored Feb 7, 2023

Unverified

This user has not yet uploaded their public signing key.
2 parents 0df6593 + ca8d6ee commit 59e5b53
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions fact_extractor/server.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import logging
import os
import traceback
from pathlib import Path
@@ -13,7 +14,7 @@
app = Flask(__name__)
api = Api(app)
config = load_config('main.cfg')
setup_logging(debug=False)
setup_logging(False, log_level=int(os.getenv('LOG_LEVEL', logging.WARNING))) # pylint: disable=invalid-envvar-default


@api.resource('/start/<folder>', methods=['GET'])
@@ -25,10 +26,10 @@ def get(self, folder):
input_dir = Path(config.get('unpack', 'data_folder'), folder, 'input')
try:
input_file = list(input_dir.iterdir())[0]
unpack(file_path=input_file, config=config, folder=folder)
unpack(file_path=str(input_file), config=config, folder=folder)
if self.owner:
change_owner_of_output_files(input_dir.parent, self.owner)
except Exception:
except Exception: # pylint: disable=broad-except
return str(traceback.format_exc()), 400

return '', 200

0 comments on commit 59e5b53

Please sign in to comment.