1 | "use strict";
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 | Object.defineProperty(exports, "__esModule", { value: true });
|
10 | exports.writeErrorToLogFile = void 0;
|
11 | const fs_1 = require("fs");
|
12 | const os_1 = require("os");
|
13 | const path_1 = require("path");
|
14 | let logPath;
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 | function writeErrorToLogFile(error) {
|
21 | if (!logPath) {
|
22 | const tempDirectory = fs_1.mkdtempSync(fs_1.realpathSync(os_1.tmpdir()) + '/ng-');
|
23 | logPath = path_1.normalize(tempDirectory + '/angular-errors.log');
|
24 | }
|
25 | fs_1.appendFileSync(logPath, '[error] ' + (error.stack || error) + '\n\n');
|
26 | return logPath;
|
27 | }
|
28 | exports.writeErrorToLogFile = writeErrorToLogFile;
|