Closed findmory closed 9 years ago
-s
already means --standalone
for browserify. I kinda like the idea of making timestamps the default though – let me think about it.
Note this might break some tools that have come to depend on the output of watchify, like livereactload.
Another option might be to explore ndjson or bole to give the user full control. The logs could be piped to garnish, bistre, and other tools.
e.g.
watchify index.js -o bundle.js --ndjson | garnish
console.log({
time: new Date().toISOString(),
level: 'info',
name: 'watchify',
elapsed: 3820,
message: '2550 bytes written to bundle.js'
});
See budo
logs for example, which prints yellow for elapsed time when it goes over a certain threshold. :smile:
Hm, thanks for the tip @mattdesl! Unfortunately, since watchify has to share its flags browserify (which has a lot), I'm reluctant to add another one.
Sorry @findmory, but this log signature is going to have to stay. However, via the API is it's really easy to build whatever kind of logging you want. Thanks for the PR though!
If you include -s or --timestamp to the watchify command you are presented with current time stamped in each console message.
For example:
yields: