Basically, I am working on a project based on typescript and node. I am able to see the output in the console/terminal. I want to copy that into a file. By copying, I want the logs in console and in a file as well.
I have tried different logging libraries, but they are able to save only those logs which are logged using them. In my project there are other logs which are printed from some modules that I have used and they don't get saved if I use a logger library.
Overriding the console.log() will also not work in my case since I won't be able to save the logs which are logged using some other node module.
PS: The project is being used at mac as well as windows machine, so want the functionality to work on both machines.
Thanks for looking into this question and your suggestions/solutions in advance.