diff --git a/common/watcher.py b/common/watcher.py index 6ebb60c..7497de1 100644 --- a/common/watcher.py +++ b/common/watcher.py @@ -22,7 +22,7 @@ class Watcher: global watcher_sock Watcher.ensure_socket_connected() # Ensure the socket is connected before attempting to log if watcher_sock: # Proceed only if sock is not None (i.e., is connected) - message_json = json.dumps({var_name: message}) + message_json = json.dumps([var_name, message]) try: watcher_sock.sendall(message_json.encode('utf-8') + b'\n') except socket.error: diff --git a/shell/watcher.js b/shell/watcher.js index db83c88..aebf4d7 100644 --- a/shell/watcher.js +++ b/shell/watcher.js @@ -49,7 +49,7 @@ function processMessage(message) { const { variable, value } = JSON.parse(message); console.log({var: variable, val: value}); const diff = calculateDiff(variable, progvars[variable], value); - console.log({diff: diff}); + console.log({diff: diff}) send_ws_message(diff); progvars[variable] = value;