Skip to main content

Filter out Neptune warnings from logs

To filter out Neptune-related warnings from logs, you can use the logging library and define a filter callback.

For example, to filter out messages starting with Skipping a non-finite value:

import logging


class _FilterCallback(logging.Filterer):
def filter(self, record: logging.LogRecord):
return not (
record.name == "neptune"
and record.getMessage().startswith("Skipping a non-finite value")
)


logging.getLogger("neptune").addFilter(_FilterCallback())