I can I write the contents of this output to a file? I'm using the debug module to log messages, I'd like to be able to pipe them to a file. However its not working as expected.
$ DEBUG=* node -e 'var debug = require("debug")("test"); debug("hello world")'
test hello world +0ms
$ DEBUG=* node -e 'var debug = require("debug")("test"); debug("hello world")' > temp.txt
test hello world +0ms
Just tried this and received no output as well.
$ { DEBUG=* node -e "var debug = require('debug')('test'); debug('hello world')"; } >temp.txt
test hello world +0ms
debug
.DEBUG_FD=3
env flag as well as 3>
to pipeHere's an example.
$ DEBUG_FD=3 DEBUG=foo node -e "require('debug')('foo')('hello')" 3> foo.txt
From the repo's issue request/question: is there a way for debug to log to a file?