Insert a marker line into the log and set self.lastmarker.
(self, key=None)
| 100 | f.write('') |
| 101 | |
| 102 | def markLog(self, key=None): |
| 103 | """Insert a marker line into the log and set self.lastmarker.""" |
| 104 | if key is None: |
| 105 | key = str(time.time()) |
| 106 | self.lastmarker = key |
| 107 | |
| 108 | with open(self.logfile, 'ab+') as f: |
| 109 | f.write( |
| 110 | b'%s%s\n' |
| 111 | % (self.markerPrefix, key.encode('utf-8')) |
| 112 | ) |
| 113 | |
| 114 | def _read_marked_region(self, marker=None): |
| 115 | """Return lines from self.logfile in the marked region. |
no test coverage detected