Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Console.log piping to a log file

ANSWERED

Hi,

Is it possible to pipe all console.logs that print from app/companion to a text file?

I'm using CLI with Visual Studio Code to build and run my app:

fitbit$ build-and-install

Now, at this point, I'd like to specify that all output from now on should be sent to a log file, eg:

fitbit$ build-and-install > log.txt

This obviously doesn't work, but hopefully you get my point. Also, when an app or companion code prints to console, it should be as well piped to the log file.

Best Answer
0 Votes
1 BEST ANSWER

Accepted Solutions

In case someone wondered, I did it on windows with:

echo build-and-install | npx fitbit > log.txt

in the terminal window.

View best answer in original post

Best Answer
1 REPLY 1

In case someone wondered, I did it on windows with:

echo build-and-install | npx fitbit > log.txt

in the terminal window.

Best Answer