Skip to content

Instantly share code, notes, and snippets.

@iGitScor
Created March 24, 2017 09:07
Show Gist options
  • Save iGitScor/aaad382650d3671782e9d462853032db to your computer and use it in GitHub Desktop.
Save iGitScor/aaad382650d3671782e9d462853032db to your computer and use it in GitHub Desktop.
Webpack content replacer plugin - Log level
var winston = require('winston'):
class Logger {
static silent; // 0
static logfile; // 1
static strictError; // 2
constructor(_loglevel) {
this.loglevel = _loglevel || Logger.silent;
this.outputWriter = new Winston(...params, this.getConfiguration());
}
getConfiguration() {
var configuration = {};
if (this.loglevel = 1) {...}
if (this.loglevel = 1) {...}
if (this.loglevel = 1) {...}
return configuration;
}
write(message) {
winston.log(message);
}
}
var Logger = require('lib/logger.js');
class WebpackContentReplacerPLugin {
constructor(options) {
this.logger = new Logger(options.loglevel);
}
replace() {
this.logger.write('Replace content...');
...
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment