Skip to content

Commit 39eb277

Browse files
denoucheTooTallNate
authored andcommitted
Use Date#toISOString() instead to Date#toUTCString() when output is not a TTY
Easier to parse programatically and contains milliseconds. Closes #418.
1 parent d5854f4 commit 39eb277

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ Then, run the program to be debugged as usual.
7979

8080
![](http://f.cl.ly/items/2i3h1d3t121M2Z1A3Q0N/Screenshot.png)
8181

82-
When stdout is not a TTY, `Date#toUTCString()` is used, making it more useful for logging the debug information as shown below:
82+
When stdout is not a TTY, `Date#toISOString()` is used, making it more useful for logging the debug information as shown below:
8383

8484
![](http://f.cl.ly/items/112H3i0e0o0P0a2Q2r11/Screenshot.png)
8585

src/node.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ function formatArgs(args) {
115115
args[0] = prefix + args[0].split('\n').join('\n' + prefix);
116116
args.push(colorCode + 'm+' + exports.humanize(this.diff) + '\u001b[0m');
117117
} else {
118-
args[0] = new Date().toUTCString()
118+
args[0] = new Date().toISOString()
119119
+ ' ' + name + ' ' + args[0];
120120
}
121121
}

0 commit comments

Comments
 (0)