Skip to content

Commit

Permalink
Fix check for exact logger name (e.g. log message from "brian2" root …
Browse files Browse the repository at this point in the history
…logger)
  • Loading branch information
mstimberg committed Mar 20, 2024
1 parent 0583e5e commit c76b8ec
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions brian2/utils/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -794,9 +794,9 @@ def __init__(self, log_list, log_level=logging.WARN, only_from=("brian2",)):

def emit(self, record):
# Append a tuple consisting of (level, name, msg) to the list of
# warnings
# log messages
if any(
record.name == self.only_from or record.name.startswith(name + ".")
record.name == name or record.name.startswith(name + ".")
for name in self.only_from
):
self.log_list.append((record.levelname, record.name, record.msg))
Expand Down

0 comments on commit c76b8ec

Please sign in to comment.