Fully stop logging and close log file. In order to start logging again, a new logstart() call needs to be made, possibly (though not necessarily) with a new filename, mode and other options.
(self)
| 201 | self.logfile.flush() |
| 202 | |
| 203 | def logstop(self): |
| 204 | """Fully stop logging and close log file. |
| 205 | |
| 206 | In order to start logging again, a new logstart() call needs to be |
| 207 | made, possibly (though not necessarily) with a new filename, mode and |
| 208 | other options.""" |
| 209 | |
| 210 | if self.logfile is not None: |
| 211 | self.logfile.close() |
| 212 | self.logfile = None |
| 213 | else: |
| 214 | print("Logging hadn't been started.") |
| 215 | self.log_active = False |
| 216 | |
| 217 | # For backwards compatibility, in case anyone was using this. |
| 218 | close_log = logstop |