MCPcopy Index your code
hub / github.com/pathwaycom/pathway / LogsOutput

Class LogsOutput

python/pathway/internals/monitoring.py:34–53  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32
33
34class LogsOutput:
35 def __init__(self, console: ConsolePrintingToBuffer) -> None:
36 self.console = console
37
38 def __rich_console__(
39 self, console: Console, options: ConsoleOptions
40 ) -> RenderResult:
41 suffix_len = options.max_height - 1
42 self.console.forget(options.max_height - 1)
43 group = Group(*self.console.logs)
44 panel = Panel(group, title="LOGS", expand=True, box=box.MINIMAL)
45
46 # if the terminal is too narrow, print only suffix of lines
47 rendered_lines = console.render_lines(panel)
48 lines = [rendered_lines[0]] + rendered_lines[1:][-suffix_len:]
49 new_line = Segment.line()
50 for i, line in enumerate(lines):
51 yield from line
52 if i + 1 < len(lines):
53 yield new_line
54
55
56class MonitoringOutput:

Callers 1

__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected