logger.js 808 B

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