Skip to content

Commit

Permalink
Use Date#toISOString() instead to Date#toUTCString() when output is n…
Browse files Browse the repository at this point in the history
…ot a TTY, which is easier to parse and contains milliseconds
  • Loading branch information
denouche committed Jan 29, 2017
1 parent 37e14d6 commit df89099
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -76,7 +76,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)

Expand Down
2 changes: 1 addition & 1 deletion src/node.js
Expand Up @@ -114,7 +114,7 @@ function formatArgs(args) {
args[0] = prefix + args[0].split('\n').join('\n' + prefix);
args.push('\u001b[3' + c + 'm+' + exports.humanize(this.diff) + '\u001b[0m');
} else {
args[0] = new Date().toUTCString()
args[0] = new Date().toISOString()
+ ' ' + name + ' ' + args[0];
}
}
Expand Down

0 comments on commit df89099

Please sign in to comment.