(self, needle: str, replace: str = "<REDACTED>")
| 50 | # retroactively redact stuff you've already leaked, so make sure |
| 51 | # you redact things as soon as possible |
| 52 | def redact(self, needle: str, replace: str = "<REDACTED>") -> None: |
| 53 | # Don't redact empty strings; this will lead to something |
| 54 | # that looks like s<REDACTED>t<REDACTED>r<REDACTED>... |
| 55 | if needle == "": |
| 56 | return |
| 57 | self.redactions[needle] = replace |
| 58 | |
| 59 | |
| 60 | formatter = Formatter(fmt="%(levelname)s: %(message)s", datefmt="") |