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)
| 214 | ) |
| 215 | |
| 216 | def logstop(self): |
| 217 | """Fully stop logging and close log file. |
| 218 | |
| 219 | In order to start logging again, a new logstart() call needs to be |
| 220 | made, possibly (though not necessarily) with a new filename, mode and |
| 221 | other options.""" |
| 222 | |
| 223 | if self.logfile is not None: |
| 224 | self.logfile.close() |
| 225 | self.logfile = None |
| 226 | else: |
| 227 | print("Logging hadn't been started.") |
| 228 | self.log_active = False |
| 229 | |
| 230 | # For backwards compatibility, in case anyone was using this. |
| 231 | close_log = logstop |