Skip to content

Commit 6edcadd

Browse files
committed
ENH: Update Logging filter type
Python logging should have filter functions that return a boolean instead of int.
1 parent e1a8957 commit 6edcadd

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/dicomweb_client/log.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import logging
44

55

6-
def _filter_header_parsing_error(record: logging.LogRecord) -> int:
6+
def _filter_header_parsing_error(record: logging.LogRecord) -> bool:
77
"""Filters warnings of ``urllib3.exceptions.HeaderParsingError``.
88
99
Parameters
@@ -13,13 +13,13 @@ def _filter_header_parsing_error(record: logging.LogRecord) -> int:
1313
1414
Returns
1515
-------
16-
int
17-
zero if the record should be filtered, non-zero otherwise
16+
bool
17+
False if the record should be filtered, True otherwise
1818
1919
"""
2020
if 'Failed to parse headers' in record.getMessage():
21-
return 0
22-
return 1
21+
return False
22+
return True
2323

2424

2525
def _map_logging_verbosity(verbosity: int) -> int:

0 commit comments

Comments
 (0)