Perhaps this is my internal bug, but this code was hard for me. At first glance, I estimated the task at 2 minutes. In fact, it turned out 10 - and I am ashamed!
I propose to tell you the time and check for how much you will write a similar task, which displays only logs on the screen.
Similar code: (I wrote in php)
$console->log('program has been started')->('parsing data ... ',false)->log('parsed')->log('finished!'). Should output the following:
out says: program has been started\n out says: parsing data ... parsed\n out says: finished!\n Update
$console->log('parsing ... ',false); //код для парсига или тяжелое что то на 5 сек sleep(5); $console->log('done '); $console->log('Finished '); The result will be
out says: parsing ...
done finished
If it is easy, why not write?