Format telemetry event message and success strings for JSON
@@ -104,7 +104,10 @@ class Watcher:
]
}}"""
- return template.format(operation, operation_success, message, duration)
+ operation_success_as_string = str(operation_success).lower()
+ formatted_message = message.replace("\n", "\\n").replace("\t", "\\t").replace('"', '\\"')
+
+ return template.format(operation, operation_success_as_string, formatted_message, duration)
def upload_telemetry(self):
status_files = [
