From d5d53c29276ea9c1a5dc6a4d5f0dcca6a02792a4 Mon Sep 17 00:00:00 2001 From: Pedro Gallardo Robinson Date: Tue, 4 Jul 2023 11:06:49 -0400 Subject: [PATCH 1/2] chore: changed logging in start --- apf/core/step.py | 5 +++-- apf/metrics/pyroscope/profile.py | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/apf/core/step.py b/apf/core/step.py index a9d967b..29eaff3 100644 --- a/apf/core/step.py +++ b/apf/core/step.py @@ -416,6 +416,7 @@ def set_producer_key_field(self, key_field: str): @profile def start(self): + logger = logging.getLogger(f"alerce.{self.__class__.__name__}") """Start running the step.""" self._pre_consume() for message in self.consumer.consume(): @@ -423,8 +424,8 @@ def start(self): try: result = self.execute(preprocessed_msg) except Exception as error: - self.logger.debug("Error at execute") - self.logger.debug(f"The message(s) that caused the error: {message}") + logger.debug("Error at execute") + logger.debug(f"The message(s) that caused the error: {message}") raise error result = self._post_execute(result) result = self._pre_produce(result) diff --git a/apf/metrics/pyroscope/profile.py b/apf/metrics/pyroscope/profile.py index 1d24640..27ef7f1 100644 --- a/apf/metrics/pyroscope/profile.py +++ b/apf/metrics/pyroscope/profile.py @@ -6,7 +6,7 @@ def profile(func): """ Creates a Pyroscope context for the function to execute """ @functools.wraps(func) def pyroscope_context(*args, **kwargs): - if os.getenv("USE_PROFILING"): + if bool(os.getenv("USE_PROFILING")): with pyroscope.tag_wrapper({ "function": func.__name__ }): func(*args, **kwargs) From 66293a74421da14f4d26fe8e768870900343aea5 Mon Sep 17 00:00:00 2001 From: Pedro Gallardo Robinson Date: Tue, 4 Jul 2023 11:12:47 -0400 Subject: [PATCH 2/2] chore: bump version --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 90d0d24..8280b6b 100644 --- a/setup.py +++ b/setup.py @@ -14,7 +14,7 @@ setup( name="apf_base", - version="2.5.1", + version="2.5.1b", description="ALeRCE Alert Processing Framework.", long_description=long_description, long_description_content_type="text/markdown",