class_docstr: Redact secrets from logs.
class_docstr_tok: ["Redact","secrets","from","logs","."]
code: def filter(self, record) -> bool:
      if settings.MASK_SECRETS_IN_LOGS is not True:
          return True
  
      if self.ALREADY_FILTERED_FLAG in record.__dict__:
          # Filters are attached to multiple handlers and logs, keep a
          # "private" flag that stops us needing to process it more than once
          return True
  
      if self.replacer:
          for k, v in record.__dict__.items():
              if k not in self._record_attrs_to_ignore:
                  record.__dict__[k] = self.redact(v)
          if record.exc_info and record.exc_info[1] is not None:
              exc = record.exc_info[1]
              self._redact_exception_with_context(exc)
      record.__dict__[self.ALREADY_FILTERED_FLAG] = True
  
      return True
  
imports: from __future__ import annotations
  import collections.abc
  import logging
  import sys
  from enum import Enum
  from functools import cached_property
  from typing import TYPE_CHECKING, Any, Callable, Dict, Generator, Iterable, Iterator, List, Pattern, TextIO, Tuple, TypeVar, Union
  import re2
  from airflow import settings
  from airflow.compat.functools import cache
label_desc: Use image node_id 4 for calling the SecretsMasker obj's underlying member method code with example usage: obj.filter(record) and returns: True, True, True