From c639b7cc1e42fdb9048904a45a894a7afec273f2 Mon Sep 17 00:00:00 2001 From: "reportportal.io" Date: Wed, 24 May 2023 11:55:52 +0000 Subject: [PATCH 1/3] Changelog update --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6a66278a..f7ef56fd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,8 @@ # Changelog ## [Unreleased] + +## [5.3.3] ### Added - `RPClient.clone()` method, by @HardNorth ### Fixed From 130d023b9a8c6dbcefa44596ad120c0dbabc4c93 Mon Sep 17 00:00:00 2001 From: "reportportal.io" Date: Wed, 24 May 2023 11:55:53 +0000 Subject: [PATCH 2/3] Version update --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 1ad9dfc3..af687580 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ from setuptools import setup, find_packages -__version__ = '5.3.3' +__version__ = '5.3.4' TYPE_STUBS = ['*.pyi'] From 6252a5334652b7898bac176a262537257ae205e8 Mon Sep 17 00:00:00 2001 From: Vadzim Hushchanskou Date: Wed, 24 May 2023 15:12:18 +0300 Subject: [PATCH 3/3] Check for parent `RPClient` object in thread before logging --- CHANGELOG.md | 2 ++ reportportal_client/logs/__init__.py | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f7ef56fd..3b8d57d8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,8 @@ # Changelog ## [Unreleased] +### Added +- Check for parent `RPClient` object in thread before logging, by @HardNorth ## [5.3.3] ### Added diff --git a/reportportal_client/logs/__init__.py b/reportportal_client/logs/__init__.py index 96ae238a..269018ed 100644 --- a/reportportal_client/logs/__init__.py +++ b/reportportal_client/logs/__init__.py @@ -14,12 +14,13 @@ import logging import sys +import threading from six import PY2 from six.moves.urllib.parse import urlparse # noinspection PyProtectedMember -from reportportal_client._local import current +from reportportal_client._local import current, set_current from reportportal_client.helpers import timestamp @@ -177,6 +178,11 @@ def emit(self, record): rp_client = self.rp_client if not rp_client: rp_client = current() + if not rp_client: + rp_client = getattr(threading.current_thread(), + 'parent_rp_client', None) + if rp_client: + set_current(rp_client) if rp_client: rp_client.log( timestamp(),