MCPcopy Create free account
hub / github.com/CJackHwang/AIstudioProxyAPI / flush

Method flush

logging_utils/core/rendering.py:240–256  ·  view source on GitHub ↗

Flush any remaining buffered message.

(self)

Source from the content-addressed store, hash-verified

238 return (formatted_line, None)
239
240 def flush(self) -> Optional[str]:
241 """Flush any remaining buffered message."""
242 with self._lock:
243 if self._last_formatted and self._count > 1:
244 # Create footnote line for repeated message
245 indent = " " * 31
246 count_line = f"{indent}{Colors.TREE}\u2514\u2500 {Colors.BURST_COUNT}(Repeated {self._count} times){Colors.RESET}"
247 result = f"{self._last_formatted}\n{count_line}"
248 self._last_key = None
249 self._last_formatted = None
250 self._count = 0
251 return result
252 # Don't return anything if count <= 1 (no repetition to report)
253 self._last_key = None
254 self._last_formatted = None
255 self._count = 0
256 return None
257
258
259# Global burst buffer instance

Callers 7

test_flush_with_countMethod · 0.95
flush_burst_bufferFunction · 0.45
updateMethod · 0.45
finishMethod · 0.45

Calls

no outgoing calls