Skip to content

Commit 9dc3c93

Browse files
committed
Add time stamp into the ti log.
1 parent a94e318 commit 9dc3c93

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

src/server/server.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -234,12 +234,6 @@ namespace ts.server {
234234
}
235235
}
236236

237-
// E.g. "12:34:56.789"
238-
function nowString() {
239-
const d = new Date();
240-
return `${d.getHours()}:${d.getMinutes()}:${d.getSeconds()}.${d.getMilliseconds()}`;
241-
}
242-
243237
interface QueuedOperation {
244238
operationId: string;
245239
operation: () => void;

src/server/shared.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,11 @@ namespace ts.server {
3333
? sys.args[index + 1]
3434
: undefined;
3535
}
36-
}
36+
37+
/*@internal*/
38+
export function nowString() {
39+
// E.g. "12:34:56.789"
40+
const d = new Date();
41+
return `${d.getHours()}:${d.getMinutes()}:${d.getSeconds()}.${d.getMilliseconds()}`;
42+
}
43+
}

src/server/typingsInstaller/nodeTypingsInstaller.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ namespace ts.server.typingsInstaller {
2121
}
2222
writeLine = (text: string) => {
2323
try {
24-
fs.appendFileSync(this.logFile, text + sys.newLine);
24+
fs.appendFileSync(this.logFile, `[${nowString()}] ${text}${sys.newLine}`);
2525
}
2626
catch (e) {
2727
this.logEnabled = false;

0 commit comments

Comments
 (0)