Skip to content

Commit

Permalink
comments
Browse files Browse the repository at this point in the history
  • Loading branch information
dakinggg committed Dec 15, 2023
1 parent 0f46b61 commit c77161e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion llmfoundry/utils/logging_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,15 @@
class SpecificWarningFilter(logging.Filter):

def __init__(self, message_to_suppress: str):
"""Filter out a specific warning message based on its content.
This can be useful for filtering out specific warning messages from third party packages.
Args:
message_to_suppress (str): The warning message to suppress.
"""
super().__init__()
self.message_to_suppress = message_to_suppress

def filter(self, record: logging.LogRecord):
def filter(self, record: logging.LogRecord) -> bool:
return self.message_to_suppress not in record.getMessage()

0 comments on commit c77161e

Please sign in to comment.