Repro case for SumoLogic/js-sumo-logger#95
git clone [email protected]:8865eb7aa8808efb9af9316e02fe8cac.git
cd 8865eb7aa8808efb9af9316e02fe8cac
npm install
node ./index.js
Visit https://requestbin.net/bins/view/5f675643874068ef43dc3bd2367f89ff214a01a9 and notice that only 1 log message is making it through.
- The
logger.log('foo')
call puts the logger in a pending state. - When the subsequent
logger.log
calls are made,this.logSending
istrue
, meaning that the second and third message remain in the queue - Not even
logger.flushLogs()
is enough to get them out, sincethis.logSending
is stilltrue
- As a result those log messages are lost when the script finishes executing