Innovenergy_trunk/frontend/node_modules/testcafe/lib/test-run/debug-log.js

25 lines
2.6 KiB
JavaScript
Raw Normal View History

"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const debug_1 = __importDefault(require("debug"));
const log_entry_1 = __importDefault(require("../utils/log-entry"));
class TestRunDebugLog {
constructor(userAgent) {
this.driverMessageLogger = (0, debug_1.default)(`testcafe:test-run:${userAgent}:driver-message`);
this.commandLogger = (0, debug_1.default)(`testcafe:test-run:${userAgent}:command`);
}
static _addEntry(logger, data) {
(0, log_entry_1.default)(logger, data);
}
driverMessage(msg) {
TestRunDebugLog._addEntry(this.driverMessageLogger, msg);
}
command(cmd) {
TestRunDebugLog._addEntry(this.commandLogger, cmd);
}
}
exports.default = TestRunDebugLog;
module.exports = exports.default;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGVidWctbG9nLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3Rlc3QtcnVuL2RlYnVnLWxvZy5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7OztBQUFBLGtEQUFnQztBQUNoQyxtRUFBMEM7QUFFMUMsTUFBcUIsZUFBZTtJQUNoQyxZQUFhLFNBQVM7UUFDbEIsSUFBSSxDQUFDLG1CQUFtQixHQUFHLElBQUEsZUFBVyxFQUFDLHFCQUFxQixTQUFTLGlCQUFpQixDQUFDLENBQUM7UUFDeEYsSUFBSSxDQUFDLGFBQWEsR0FBUyxJQUFBLGVBQVcsRUFBQyxxQkFBcUIsU0FBUyxVQUFVLENBQUMsQ0FBQztJQUNyRixDQUFDO0lBRUQsTUFBTSxDQUFDLFNBQVMsQ0FBRSxNQUFNLEVBQUUsSUFBSTtRQUMxQixJQUFBLG1CQUFRLEVBQUMsTUFBTSxFQUFFLElBQUksQ0FBQyxDQUFDO0lB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