From 0b81819d837294d30f90d3672dc3c5177edec253 Mon Sep 17 00:00:00 2001 From: Brian Kelly Date: Sun, 24 Sep 2023 11:46:50 -0500 Subject: [PATCH] Log request details: number of files, size, output format --- app.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app.py b/app.py index 3a3adb5..0489a5a 100644 --- a/app.py +++ b/app.py @@ -39,8 +39,12 @@ def get_merge_gpx_tracks(): def post_merge_gpx_tracks(): """Processes Merge GPX Tracks form""" files = request.files.getlist("files") - extension = formats[request.form["format"]]["extension"] - driver = formats[request.form["format"]]["driver"] + output_format = request.form["format"] + extension = formats[output_format]["extension"] + driver = formats[output_format]["driver"] + + app.logger.info("%i files submitted for %s output", len(files), output_format) + app.logger.info("%f kilobytes received", request.content_length / 1024) merged_tracks = geopandas.GeoDataFrame( columns=["name", "type", "geometry"], geometry="geometry"