diff --git a/pyproject.toml b/pyproject.toml index 1da0098..99ea900 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "delta-barth" -version = "0.3.0" +version = "0.3.1" description = "prognosis module" authors = [ {name = "Florian Förster", email = "f.foerster@d-opt.com"}, diff --git a/src/delta_barth/analysis/forecast.py b/src/delta_barth/analysis/forecast.py index 6d4480d..0a650f0 100644 --- a/src/delta_barth/analysis/forecast.py +++ b/src/delta_barth/analysis/forecast.py @@ -22,6 +22,7 @@ from delta_barth.constants import ( MIN_NUMBER_DATAPOINTS, ) from delta_barth.errors import STATUS_HANDLER, wrap_result +from delta_barth.logging import logger_pipelines as logger from delta_barth.types import ( DualDict, PipeResult, @@ -293,6 +294,11 @@ def pipeline_sales( start_date=start_date, ) if status != STATUS_HANDLER.SUCCESS: + logger.error( + "Error during sales prognosis data retrieval, Status: %s", + status, + stack_info=True, + ) return _export_on_fail(status) pipe = _preprocess_sales( @@ -301,6 +307,11 @@ def pipeline_sales( target_features=FEATURES_SALES_PROGNOSIS, ) if pipe.status != STATUS_HANDLER.SUCCESS: + logger.error( + "Error during sales prognosis preprocessing, Status: %s", + pipe.status, + stack_info=True, + ) return _export_on_fail(pipe.status) pipe = _process_sales( @@ -308,6 +319,11 @@ def pipeline_sales( min_num_data_points=MIN_NUMBER_DATAPOINTS, ) if pipe.status != STATUS_HANDLER.SUCCESS: + logger.error( + "Error during sales prognosis main processing, Status: %s", + pipe.status, + stack_info=True, + ) return _export_on_fail(pipe.status) pipe = _postprocess_sales( @@ -315,6 +331,11 @@ def pipeline_sales( feature_map=DualDict(), ) if pipe.status != STATUS_HANDLER.SUCCESS: + logger.error( + "Error during sales prognosis postprocessing, Status: %s", + pipe.status, + stack_info=True, + ) return _export_on_fail(pipe.status) assert pipe.results is not None, "needed export response not set in pipeline" diff --git a/src/delta_barth/errors.py b/src/delta_barth/errors.py index 0df1837..069d6d7 100644 --- a/src/delta_barth/errors.py +++ b/src/delta_barth/errors.py @@ -242,7 +242,10 @@ def wrap_result( fmt_exc = traceback.format_exception(err) exc_str = "".join(fmt_exc) logger.error( - "An exception in routine %s occured:\n%s", func.__name__, exc_str + "An exception in routine %s occurred:\n%s", + func.__name__, + exc_str, + stack_info=True, ) return status diff --git a/src/delta_barth/logging.py b/src/delta_barth/logging.py index 0b946fc..871971f 100644 --- a/src/delta_barth/logging.py +++ b/src/delta_barth/logging.py @@ -51,3 +51,5 @@ logger_all.addHandler(logger_all_handler_file) logger_wrapped_results = logging.getLogger("delta_barth.wrapped_results") logger_wrapped_results.setLevel(logging.DEBUG) +logger_pipelines = logging.getLogger("delta_barth.logger_pipelines") +logger_pipelines.setLevel(logging.DEBUG)