From 39eb2770a2ae2e9cd51356d2f6324616484274c3 Mon Sep 17 00:00:00 2001 From: "antoine.leveugle" Date: Sun, 29 Jan 2017 17:10:42 +0100 Subject: [PATCH] Use Date#toISOString() instead to Date#toUTCString() when output is not a TTY Easier to parse programatically and contains milliseconds. Closes #418. --- README.md | 2 +- src/node.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3748db94..bca8417e 100644 --- a/README.md +++ b/README.md @@ -79,7 +79,7 @@ Then, run the program to be debugged as usual. ![](http://f.cl.ly/items/2i3h1d3t121M2Z1A3Q0N/Screenshot.png) - When stdout is not a TTY, `Date#toUTCString()` is used, making it more useful for logging the debug information as shown below: + When stdout is not a TTY, `Date#toISOString()` is used, making it more useful for logging the debug information as shown below: ![](http://f.cl.ly/items/112H3i0e0o0P0a2Q2r11/Screenshot.png) diff --git a/src/node.js b/src/node.js index bc3d8d0d..ae556fc0 100644 --- a/src/node.js +++ b/src/node.js @@ -115,7 +115,7 @@ function formatArgs(args) { args[0] = prefix + args[0].split('\n').join('\n' + prefix); args.push(colorCode + 'm+' + exports.humanize(this.diff) + '\u001b[0m'); } else { - args[0] = new Date().toUTCString() + args[0] = new Date().toISOString() + ' ' + name + ' ' + args[0]; } }