MCPcopy Create free account
hub / github.com/agentscope-ai/Trinity-RFT / read_new_lines

Method read_new_lines

trinity/manager/log_manager.py:124–142  ·  view source on GitHub ↗

Read newly added lines

(self)

Source from the content-addressed store, hash-verified

122 return False
123
124 def read_new_lines(self) -> List[str]:
125 """Read newly added lines"""
126 lines = []
127 try:
128 if self.check_rotation():
129 if self.open_file():
130 return []
131
132 while True:
133 line = self.file.readline()
134 if not line:
135 break
136 lines.append(line.rstrip("\n"))
137
138 self.file_size = self.file.tell()
139 except Exception as e:
140 print(f"{Colors.RED}[ERROR] Error reading file {self.filepath}: {e}{Colors.RESET}")
141
142 return lines
143
144 def parse_log_level(self, line: str) -> int:
145 """Parse log level"""

Callers 3

monitorMethod · 0.80
test_file_rotationMethod · 0.80

Calls 2

check_rotationMethod · 0.95
open_fileMethod · 0.95

Tested by 2

test_file_rotationMethod · 0.64