Browse Source

Add metadata to report tool

Lennart Grahl 6 years ago
parent
commit
1439334b58
1 changed files with 10 additions and 3 deletions
  1. 10 3
      src/controllers/troubleshooting.ts

+ 10 - 3
src/controllers/troubleshooting.ts

@@ -186,9 +186,16 @@ export class TroubleshootingController extends DialogController {
      * Serialise the memory log and add some metadata.
      */
     private getLog(): string {
-        const records = this.logService.memory.getRecords();
+        const browser = this.browserService.getBrowser();
+
+        // Create container for meta data and log records
+        const container = {
+            config: this.config,
+            browser: browser.description(),
+            log: this.logService.memory.getRecords(),
+        };
 
-        // TODO: Add metadata to report
-        return JSON.stringify(records, MemoryLogger.replacer);
+        // Return serialised and sanitised
+        return JSON.stringify(container, MemoryLogger.replacer, 2);
     }
 }