MCPcopy Create free account
hub / github.com/LangGraph-GUI/LangGraph-GUI-backend / write

Method write

src/ServerTee.py:22–42  ·  view source on GitHub ↗
(self, message)

Source from the content-addressed store, hash-verified

20 sys.stdout = self # redirect global stdout
21
22 def write(self, message):
23 with self.lock:
24 self.buffer += message
25 while '\n' in self.buffer:
26 line, self.buffer = self.buffer.split('\n', 1)
27 # Skip completely empty lines
28 if not line.strip():
29 continue
30 timestamp = datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')
31 message_with_timestamp = f"{timestamp} - {line}\n"
32
33 # Write to original stdout
34 self.stdout.write(message_with_timestamp)
35 self.stdout.flush()
36
37 # Write to log file
38 self.file.write(message_with_timestamp)
39 self.file.flush()
40
41 # Notify subscribers
42 self.notify_subscribers(message_with_timestamp)
43
44 def flush(self):
45 with self.lock:

Callers 3

download_workspaceFunction · 0.80
upload_fileFunction · 0.80
flushMethod · 0.80

Calls 2

notify_subscribersMethod · 0.95
flushMethod · 0.80

Tested by

no test coverage detected