Hector Dearman | 21fa916 | 2018-06-22 14:50:29 +0100 | [diff] [blame^] | 1 | import * as init_trace_processor from './gen/trace_processor'; |
| 2 | |
| 3 | function writeToUIConsole(line:string) { |
| 4 | const lineElement = document.createElement('div'); |
| 5 | lineElement.innerText = line; |
| 6 | const container = document.getElementById('console'); |
| 7 | if (!container) |
| 8 | throw new Error('OMG'); |
| 9 | container.appendChild(lineElement); |
| 10 | } |
| 11 | |
| 12 | init_trace_processor({ |
| 13 | locateFile: (s: string) => s, |
| 14 | print: writeToUIConsole, |
| 15 | printErr: writeToUIConsole, |
| 16 | }); |
| 17 | |