Skip to content

Commit 101eaa5

Browse files
committed
ignored_record_names moved into constructor parameters in handler
1 parent 3d30cd8 commit 101eaa5

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

reportportal_client/logs/__init__.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
from six import PY2
1919
from six.moves.urllib.parse import urlparse
2020

21-
from reportportal_client.helpers import timestamp
2221
from reportportal_client._local import current
22+
from reportportal_client.helpers import timestamp
2323

2424

2525
class RPLogger(logging.getLoggerClass()):
@@ -96,21 +96,22 @@ class RPLogHandler(logging.Handler):
9696
}
9797
_sorted_levelnos = sorted(_loglevel_map.keys(), reverse=True)
9898

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')):
102102
"""
103103
Initialize RPLogHandler instance.
104104
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
107107
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)
109111
"""
110112
super(RPLogHandler, self).__init__(level)
111113
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
114115
self.endpoint = endpoint
115116

116117
def filter(self, record):

0 commit comments

Comments
 (0)