MCPcopy
hub / github.com/cherrypy/cherrypy / markLog

Method markLog

cherrypy/test/logtest.py:102–112  ·  view source on GitHub ↗

Insert a marker line into the log and set self.lastmarker.

(self, key=None)

Source from the content-addressed store, hash-verified

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.

Callers 6

test_normal_returnFunction · 0.80
test_normal_yieldFunction · 0.80
test_custom_log_formatFunction · 0.80
test_timez_log_formatFunction · 0.80
test_escaped_outputFunction · 0.80

Calls 3

timeMethod · 0.80
writeMethod · 0.80
encodeMethod · 0.80

Tested by

no test coverage detected