* We use a global boolean to know if all of our messages have been flushed, and the functions * emulator can wait on this variable to flip before exiting. This ensures that we never * miss a log message that has been queued but has not yet flushed.
()
| 340 | * miss a log message that has been queued but has not yet flushed. |
| 341 | */ |
| 342 | log(): void { |
| 343 | const msg = `${this.toString()}\n`; |
| 344 | this.bufferMessage(msg); |
| 345 | this.flush(); |
| 346 | } |
| 347 | |
| 348 | private bufferMessage(msg: string): void { |
| 349 | EmulatorLog.LOG_BUFFER.push(msg); |