|
18 | 18 | from six import PY2
|
19 | 19 | from six.moves.urllib.parse import urlparse
|
20 | 20 |
|
21 |
| -from reportportal_client.helpers import timestamp |
22 | 21 | from reportportal_client._local import current
|
| 22 | +from reportportal_client.helpers import timestamp |
23 | 23 |
|
24 | 24 |
|
25 | 25 | class RPLogger(logging.getLoggerClass()):
|
@@ -96,21 +96,22 @@ class RPLogHandler(logging.Handler):
|
96 | 96 | }
|
97 | 97 | _sorted_levelnos = sorted(_loglevel_map.keys(), reverse=True)
|
98 | 98 |
|
99 |
| - def __init__(self, level=logging.NOTSET, |
100 |
| - filter_client_logs=False, |
101 |
| - endpoint=None): |
| 99 | + def __init__(self, level=logging.NOTSET, filter_client_logs=False, |
| 100 | + endpoint=None, |
| 101 | + ignored_record_names=tuple('reportportal_client')): |
102 | 102 | """
|
103 | 103 | Initialize RPLogHandler instance.
|
104 | 104 |
|
105 |
| - :param level: level of logging |
106 |
| - :param filter_client_logs: if True throw away logs emitted by a |
| 105 | + :param level: level of logging |
| 106 | + :param filter_client_logs: if True throw away logs emitted by a |
107 | 107 | ReportPortal client
|
108 |
| - :param endpoint: link to send reports |
| 108 | + :param endpoint: link to send reports |
| 109 | + :param ignored_record_names: a tuple of record names which will be |
| 110 | + filtered out by the handler (with startswith method) |
109 | 111 | """
|
110 | 112 | super(RPLogHandler, self).__init__(level)
|
111 | 113 | self.filter_client_logs = filter_client_logs
|
112 |
| - self.ignored_record_names = ('reportportal_client', |
113 |
| - 'pytest_reportportal') |
| 114 | + self.ignored_record_names = ignored_record_names |
114 | 115 | self.endpoint = endpoint
|
115 | 116 |
|
116 | 117 | def filter(self, record):
|
|
0 commit comments