Skip to content

Commit

Permalink
Merge pull request #212 from reportportal/develop
Browse files Browse the repository at this point in the history
Release
  • Loading branch information
HardNorth authored May 24, 2023
2 parents be275f3 + 6252a53 commit 7db8dc5
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## [Unreleased]
### Added
- Check for parent `RPClient` object in thread before logging, by @HardNorth

## [5.3.3]
### Added
- `RPClient.clone()` method, by @HardNorth
### Fixed
- Client crash in case of Client ID reading error, by @HardNorth
Expand Down
8 changes: 7 additions & 1 deletion reportportal_client/logs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down Expand Up @@ -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(),
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from setuptools import setup, find_packages

__version__ = '5.3.3'
__version__ = '5.3.4'

TYPE_STUBS = ['*.pyi']

Expand Down

0 comments on commit 7db8dc5

Please sign in to comment.