|
1 |
| -import { createWriteStream, existsSync, unlinkSync, writeFileSync } from 'fs'; |
| 1 | +import { existsSync, unlinkSync, writeFileSync } from 'fs'; |
2 | 2 | import ts from 'typescript';
|
3 |
| -import { format } from 'util'; |
4 | 3 |
|
5 | 4 | if (existsSync('tmp/log.txt')) {
|
6 | 5 | unlinkSync('tmp/log.txt');
|
7 | 6 | }
|
8 | 7 |
|
9 |
| -const logFile = createWriteStream('tmp/log.txt', { flags: 'a' }); |
10 |
| -// Or 'w' to truncate the file every time the process starts. |
11 |
| -const logStdout = process.stdout; |
12 |
| - |
13 |
| -function writeToLog() { |
14 |
| - logFile.write(format.apply(null, [`------${new Date().toLocaleDateString()}------`, '\n'])); |
15 |
| - // Storing without color codes |
16 |
| - logFile.write(format.apply(null, arguments).replace(/\033\[[0-9;]*m/g, '') + '\n'); |
17 |
| - // Display normally, with colors to Stdout |
18 |
| - logStdout.write(format.apply(null, arguments) + '\n'); |
19 |
| -} |
| 8 | +// const logFile = createWriteStream('tmp/log.txt', { flags: 'a' }); |
| 9 | +// // Or 'w' to truncate the file every time the process starts. |
| 10 | +// const logStdout = process.stdout; |
| 11 | +// |
| 12 | +// function writeToLog() { |
| 13 | +// logFile.write(format.apply(null, [`------${new Date().toLocaleDateString()}------`, '\n'])); |
| 14 | +// // Storing without color codes |
| 15 | +// logFile.write(format.apply(null, arguments).replace(/\033\[[0-9;]*m/g, '') + '\n'); |
| 16 | +// // Display normally, with colors to Stdout |
| 17 | +// logStdout.write(format.apply(null, arguments) + '\n'); |
| 18 | +// } |
20 | 19 |
|
21 | 20 | const TYPE_CHECKER_FLAGS =
|
22 | 21 | ts.NodeBuilderFlags.NoTruncation | ts.NodeBuilderFlags.InTypeAlias | ts.NodeBuilderFlags.NoTypeReduction;
|
|
0 commit comments