UNPKG

911 BJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3exports.rootLogger = void 0;
4var bs_logger_1 = require("bs-logger");
5var backports_1 = require("./backports");
6var original = process.env.TS_JEST_LOG;
7var buildOptions = function () {
8 var _a;
9 return ({
10 context: (_a = {},
11 _a[bs_logger_1.LogContexts.package] = 'ts-jest',
12 _a[bs_logger_1.LogContexts.logLevel] = bs_logger_1.LogLevels.trace,
13 _a.version = require('../../package.json').version,
14 _a),
15 targets: process.env.TS_JEST_LOG || undefined,
16 });
17};
18exports.rootLogger = (0, bs_logger_1.createLogger)(buildOptions());
19(0, backports_1.backportTsJestDebugEnvVar)(exports.rootLogger);
20// re-create the logger if the env var has been backported
21if (original !== process.env.TS_JEST_LOG) {
22 exports.rootLogger = (0, bs_logger_1.createLogger)(buildOptions());
23}