(self, ifile, ofile, processor)
| 41 | self.regular_log = RegularLogProcessor(salt) |
| 42 | |
| 43 | def _process_file(self, ifile, ofile, processor): |
| 44 | try: |
| 45 | with get_open_fn(ifile)( |
| 46 | ifile, |
| 47 | "rb", |
| 48 | ) as inp: |
| 49 | with get_open_fn(ofile)( |
| 50 | ofile, |
| 51 | "wb+", |
| 52 | ) as out: |
| 53 | # Write redaction header |
| 54 | out.write(self.couchbase_log.do(b"RedactLevel")) |
| 55 | for line in inp: |
| 56 | out.write(processor.do(line)) |
| 57 | except IOError as e: |
| 58 | log("I/O error(%s): %s" % (e.errno, e.strerror)) |
| 59 | |
| 60 | def redact_file(self, name, ifile): |
| 61 | _, filename = os.path.split(name) |
no test coverage detected