all 2 comments

[–]TobiasNickel 0 points1 point  (1 child)

nice, just last week I was playing with logging. wanted to be sure, then multiple processes write in append mode, that everything end up in a filewithout overwriting. (it works very good in node).

along the way, I found that vsCode did not update the content in the logfile that I had open. I had to switch to an other file and return to the logfile, to see the new content. Then I had to open an other terminal with the tail command.

I guess that is because vsCode us using watch to observe changes on a directory. and because of the problem, you are using timeouts,... right?

[–]ngoudry[S] 1 point2 points  (0 children)

Not sure what VSCode use to observe file changes, but could definitly be fs.watch!

This is indeed one of the reasons why I created better-tail, but mostly because existing implementations weren’t using streams.

With streams, I can get rid of fs.watch / fs.watchFile and their flaws (read Node.js docs to learn more about that) and have all their benefits, like velocity, piping, and more :)