Skip to content

Commit

Permalink
suggestions implemented
Browse files Browse the repository at this point in the history
  • Loading branch information
0dm committed Jun 2, 2023
1 parent e044d13 commit a61c812
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions openadapt/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,15 @@ def configure_logging(logger, log_level):
log_level_override = os.getenv("LOG_LEVEL")
log_level = log_level_override or log_level
logger.remove()
logger.add(sys.stderr, level=log_level, filter=good_filter)
logger.add(sys.stderr, level=log_level, filter=filter_log_messages)
logger.debug(f"{log_level=}")


def good_filter(data):
def filter_log_messages(data):
messages_to_ignore = [
"Cannot pickle Objective-C objects')",
"Cannot pickle Objective-C objects",
]

return not any(data["message"].endswith(msg) for msg in messages_to_ignore)
return not any(msg in data["message"] for msg in messages_to_ignore)


def row2dict(row, follow=True):
Expand Down

0 comments on commit a61c812

Please sign in to comment.