source: trip-planner-front/node_modules/@angular/cli/utilities/log-file.js@ 571e0df

Last change on this file since 571e0df was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 998 bytes
RevLine 
[6a3a178]1"use strict";
2/**
3 * @license
4 * Copyright Google LLC All Rights Reserved.
5 *
6 * Use of this source code is governed by an MIT-style license that can be
7 * found in the LICENSE file at https://angular.io/license
8 */
9Object.defineProperty(exports, "__esModule", { value: true });
10exports.writeErrorToLogFile = void 0;
11const fs_1 = require("fs");
12const os_1 = require("os");
13const path_1 = require("path");
14let logPath;
15/**
16 * Writes an Error to a temporary log file.
17 * If this method is called multiple times from the same process the same log file will be used.
18 * @returns The path of the generated log file.
19 */
20function 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}
28exports.writeErrorToLogFile = writeErrorToLogFile;
Note: See TracBrowser for help on using the repository browser.