Skip to content

Commit 7db8dc5

Browse files
authored
Merge pull request #212 from reportportal/develop
Release
2 parents be275f3 + 6252a53 commit 7db8dc5

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## [Unreleased]
44
### Added
5+
- Check for parent `RPClient` object in thread before logging, by @HardNorth
6+
7+
## [5.3.3]
8+
### Added
59
- `RPClient.clone()` method, by @HardNorth
610
### Fixed
711
- Client crash in case of Client ID reading error, by @HardNorth

reportportal_client/logs/__init__.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,13 @@
1414

1515
import logging
1616
import sys
17+
import threading
1718

1819
from six import PY2
1920
from six.moves.urllib.parse import urlparse
2021

2122
# noinspection PyProtectedMember
22-
from reportportal_client._local import current
23+
from reportportal_client._local import current, set_current
2324
from reportportal_client.helpers import timestamp
2425

2526

@@ -177,6 +178,11 @@ def emit(self, record):
177178
rp_client = self.rp_client
178179
if not rp_client:
179180
rp_client = current()
181+
if not rp_client:
182+
rp_client = getattr(threading.current_thread(),
183+
'parent_rp_client', None)
184+
if rp_client:
185+
set_current(rp_client)
180186
if rp_client:
181187
rp_client.log(
182188
timestamp(),

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
from setuptools import setup, find_packages
66

7-
__version__ = '5.3.3'
7+
__version__ = '5.3.4'
88

99
TYPE_STUBS = ['*.pyi']
1010

0 commit comments

Comments
 (0)