From 3f2b9806feec3d40a92f07ea9e980450a8e21ca6 Mon Sep 17 00:00:00 2001 From: lukas leufen <l.leufen@fz-juelich.de> Date: Thu, 18 Mar 2021 10:20:14 +0000 Subject: [PATCH] include new logging --- mlair/run_modules/pre_processing.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mlair/run_modules/pre_processing.py b/mlair/run_modules/pre_processing.py index 813873b8..7f3ce51e 100644 --- a/mlair/run_modules/pre_processing.py +++ b/mlair/run_modules/pre_processing.py @@ -9,6 +9,7 @@ from typing import Tuple import multiprocessing import requests import psutil +import traceback import numpy as np import pandas as pd @@ -336,6 +337,7 @@ def f_proc(data_handler, station, name_affix, store, **kwargs): try: res = data_handler.build(station, name_affix=name_affix, store_processed_data=store, **kwargs) except (AttributeError, EmptyQueryResult, KeyError, requests.ConnectionError, ValueError) as e: - logging.info(f"remove station {station} because it raised an error: {e}") + formatted_lines = traceback.format_exc().splitlines() + logging.info(f"remove station {station} because it raised an error: {e} (from {' | '.join(formatted_lines[-3:])}") res = None return res, station -- GitLab