File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change 1
1
# Changelog
2
2
3
3
## [ Unreleased]
4
+ ### Added
5
+ - Check for parent ` RPClient ` object in thread before logging, by @HardNorth
4
6
5
7
## [ 5.3.3]
6
8
### Added
Original file line number Diff line number Diff line change 14
14
15
15
import logging
16
16
import sys
17
+ import threading
17
18
18
19
from six import PY2
19
20
from six .moves .urllib .parse import urlparse
20
21
21
22
# noinspection PyProtectedMember
22
- from reportportal_client ._local import current
23
+ from reportportal_client ._local import current , set_current
23
24
from reportportal_client .helpers import timestamp
24
25
25
26
@@ -177,6 +178,11 @@ def emit(self, record):
177
178
rp_client = self .rp_client
178
179
if not rp_client :
179
180
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 )
180
186
if rp_client :
181
187
rp_client .log (
182
188
timestamp (),
You can’t perform that action at this time.
0 commit comments