You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
755 B

2 years ago
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const WebpackInfrastructureLogger_1 = require("./WebpackInfrastructureLogger");
const PartialLogger_1 = require("./PartialLogger");
function createLogger(type, compiler) {
if (typeof type !== 'string') {
return type;
}
switch (type) {
case 'webpack-infrastructure':
return (WebpackInfrastructureLogger_1.createWebpackInfrastructureLogger(compiler) ||
PartialLogger_1.createPartialLogger(['log', 'error'], console));
case 'silent':
return PartialLogger_1.createPartialLogger([], console);
case 'console':
default:
return console;
}
}
exports.createLogger = createLogger;