Compress the source file and move it to the destination.
(self, source, dest)
| 72 | return default_name + ".gz" |
| 73 | |
| 74 | def rotate(self, source, dest): |
| 75 | """ |
| 76 | Compress the source file and move it to the destination. |
| 77 | """ |
| 78 | import gzip |
| 79 | |
| 80 | with open(source, "rb") as f_in: |
| 81 | with gzip.open(dest, "wb") as f_out: |
| 82 | f_out.writelines(f_in) |
| 83 | os.remove(source) |
| 84 | |
| 85 | def emit(self, record): |
| 86 | """ |