mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-09 20:51:43 -06:00
Add current time to tsserver logs (#17268)
This commit is contained in:
parent
441daa4e19
commit
7702d15cf3
@ -200,7 +200,7 @@ namespace ts.server {
|
||||
|
||||
msg(s: string, type: Msg.Types = Msg.Err) {
|
||||
if (this.fd >= 0 || this.traceToConsole) {
|
||||
s = s + "\n";
|
||||
s = `[${nowString()}] ${s}\n`;
|
||||
const prefix = Logger.padStringRight(type + " " + this.seq.toString(), " ");
|
||||
if (this.firstInGroup) {
|
||||
s = prefix + s;
|
||||
@ -222,6 +222,12 @@ namespace ts.server {
|
||||
}
|
||||
}
|
||||
|
||||
// E.g. "12:34:56.789"
|
||||
function nowString() {
|
||||
const d = new Date();
|
||||
return `${d.getHours()}:${d.getMinutes()}:${d.getSeconds()}.${d.getMilliseconds()}`;
|
||||
}
|
||||
|
||||
class NodeTypingsInstaller implements ITypingsInstaller {
|
||||
private installer: NodeChildProcess;
|
||||
private installerPidReported = false;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user