Skip to content

Commit

Permalink
BUG: replace deprecated logging.warn with logging.warning
Browse files Browse the repository at this point in the history
fixes #2013
  • Loading branch information
Sebastian Wagner committed Jul 2, 2021
1 parent 14ac479 commit b6bfe06
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions intelmq/bots/collectors/file/collector_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ def init(self):
expected="directory")

if not self.postfix:
self.logger.warn("No file extension was set. The collector will"
" read all files in %s.", self.path)
self.logger.warning("No file extension was set. The collector will"
" read all files in %s.", self.path)
if self.delete_file:
self.logger.error("This configuration would delete all files"
" in %s. I'm stopping now....",
Expand Down
4 changes: 2 additions & 2 deletions intelmq/bots/experts/rdap/expert.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def process(self):
raise ValueError("Unable to parse server response as JSON. Enable debug logging to see more details.")
for entity in resp['entities']:
if not isinstance(entity, dict):
self.logger.warn("Invalid type '%s' in entities of response for domain '%s' found.", type(entity), url)
self.logger.warning("Invalid type '%s' in entities of response for domain '%s' found.", type(entity), url)
continue

if 'removed' in entity['roles']:
Expand All @@ -123,7 +123,7 @@ def process(self):
if 'entities' in entity:
for subentity in entity['entities']:
if not isinstance(subentity, dict):
self.logger.warn("Invalid type '%s' in entities of response for domain '%s' found.", type(subentity), url)
self.logger.warning("Invalid type '%s' in entities of response for domain '%s' found.", type(subentity), url)
continue

for subentrole in subentity['roles']:
Expand Down
2 changes: 1 addition & 1 deletion intelmq/bots/outputs/tcp/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def process(self):
response = self.con.recv(2)
if response == b"Ok":
break
self.logger.warn("Message not delivered, retrying.")
self.logger.warning("Message not delivered, retrying.")
time.sleep(1)
else:
break
Expand Down
4 changes: 2 additions & 2 deletions intelmq/bots/parsers/key_value/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ def parse_line(self, row, report):
value = parse(value, fuzzy=True).isoformat() + " UTC"
except ValueError:
value = None # Will be ignored by event.add()
self.logger.warn("Could not parse key %r for 'time.source'."
" Ignoring this key in line %r.", (value, row))
self.logger.warning("Could not parse key %r for 'time.source'."
" Ignoring this key in line %r.", (value, row))
if key in self.keys:
event.add(self.keys[key], value, raise_failure=False)
event.add("raw", self.recover_line(row))
Expand Down
8 changes: 4 additions & 4 deletions intelmq/bots/parsers/microsoft/parser_bingmurls.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ def parse_line(self, line, report):
if value[0] != '??':
event.add('source.geolocation.cc', value[0])
continue
self.logger.warn("Field 'Tags' does not have expected "
"length 1, but %r. Saving as %r, but "
"please report this as bug with samples."
"" % (len(value), MAPPING[key]))
self.logger.warning("Field 'Tags' does not have expected "
"length 1, but %r. Saving as %r, but "
"please report this as bug with samples."
"" % (len(value), MAPPING[key]))
event[MAPPING[key]] = value
event.add('classification.type', 'blacklist')
event.add('raw', raw)
Expand Down

0 comments on commit b6bfe06

Please sign in to comment.