metarhia/metalog

Support Logging before Infinite Loop

nechaido opened this issue · 1 comments

At the moment if the process encounters an infinite loop it is possible to loose console.log output, from the same sync block.

I believe there should be a way to force process.stdout to write everything to he output right now.

There could be at least two different approaches:

  1. make logging process synchronous;
  2. run logger in separate thread.

First one could cause problems in case of high logging rate.
The second one will increase overhead on communication between threads as logging units (messages) could be potential big in size.

Additionaly we can introduce SharedArrayBuffer as a temporary storage for logging messages to reduce inter-thread communication overhead.
This improvement would also require adding some kind of dispatcher, such as a semaphore, to sync reads and writes.