mirror of
https://github.com/debug-js/debug.git
synced 2026-01-25 16:42:28 +00:00
Use Date#toISOString() instead to Date#toUTCString() when output is not a TTY
Easier to parse programatically and contains milliseconds. Closes #418.
This commit is contained in:
parent
d5854f4eb6
commit
39eb2770a2
@ -79,7 +79,7 @@ Then, run the program to be debugged as usual.
|
||||
|
||||

|
||||
|
||||
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:
|
||||
|
||||

|
||||
|
||||
|
||||
@ -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];
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user