Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
67 additions
and
155 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
module.exports = class LogTestPlugin { | ||
constructor(noTraced) { | ||
this.noTraced = noTraced; | ||
} | ||
apply(compiler) { | ||
const logSome = logger => { | ||
logger.group("Group"); | ||
if (!this.noTraced) { | ||
logger.error("Error"); | ||
logger.warn("Warning"); | ||
} | ||
logger.info("Info"); | ||
logger.log("Log"); | ||
logger.debug("Debug"); | ||
logger.groupCollapsed("Collaped group"); | ||
logger.log("Log inside collapsed group"); | ||
logger.groupEnd(); | ||
logger.log("Log"); | ||
logger.groupEnd(); | ||
logger.log("End"); | ||
}; | ||
compiler.hooks.compilation.tap("LogTestPlugin", compilation => { | ||
const logger = compilation.getLogger("LogTestPlugin"); | ||
logSome(logger); | ||
|
||
const otherLogger = compilation.getLogger("LogOtherTestPlugin"); | ||
otherLogger.debug("debug message only"); | ||
}); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,8 @@ | ||
class MyPlugin { | ||
apply(compiler) { | ||
compiler.hooks.compilation.tap("MyPlugin", compilation => { | ||
const logger = compilation.getLogger("MyPlugin"); | ||
logger.group("Group"); | ||
logger.error("Error"); | ||
logger.warn("Warning"); | ||
logger.info("Info"); | ||
logger.log("Log"); | ||
logger.debug("Debug"); | ||
logger.groupCollapsed("Collaped group"); | ||
logger.log("Log inside collapsed group"); | ||
logger.groupEnd(); | ||
logger.groupEnd(); | ||
}); | ||
} | ||
} | ||
const LogTestPlugin = require("../../helpers/LogTestPlugin"); | ||
|
||
module.exports = { | ||
mode: "production", | ||
entry: "./index", | ||
stats: "detailed", | ||
plugins: [new MyPlugin()] | ||
plugins: [new LogTestPlugin()] | ||
}; |
20 changes: 2 additions & 18 deletions
20
test/statsCases/preset-errors-only-error/webpack.config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,8 @@ | ||
class MyPlugin { | ||
apply(compiler) { | ||
compiler.hooks.compilation.tap("MyPlugin", compilation => { | ||
const logger = compilation.getLogger("MyPlugin"); | ||
logger.group("Group"); | ||
logger.error("Error"); | ||
logger.warn("Warning"); | ||
logger.info("Info"); | ||
logger.log("Log"); | ||
logger.debug("Debug"); | ||
logger.groupCollapsed("Collaped group"); | ||
logger.log("Log inside collapsed group"); | ||
logger.groupEnd(); | ||
logger.groupEnd(); | ||
}); | ||
} | ||
} | ||
const LogTestPlugin = require("../../helpers/LogTestPlugin"); | ||
|
||
module.exports = { | ||
mode: "production", | ||
entry: "./index", | ||
stats: "errors-only", | ||
plugins: [new MyPlugin()] | ||
plugins: [new LogTestPlugin()] | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,8 @@ | ||
class MyPlugin { | ||
apply(compiler) { | ||
compiler.hooks.compilation.tap("MyPlugin", compilation => { | ||
const logger = compilation.getLogger("MyPlugin"); | ||
logger.group("Group"); | ||
logger.error("Error"); | ||
logger.warn("Warning"); | ||
logger.info("Info"); | ||
logger.log("Log"); | ||
logger.debug("Debug"); | ||
logger.groupCollapsed("Collaped group"); | ||
logger.log("Log inside collapsed group"); | ||
logger.groupEnd(); | ||
logger.groupEnd(); | ||
}); | ||
} | ||
} | ||
const LogTestPlugin = require("../../helpers/LogTestPlugin"); | ||
|
||
module.exports = { | ||
mode: "production", | ||
entry: "./index", | ||
stats: "errors-warnings", | ||
plugins: [new MyPlugin()] | ||
plugins: [new LogTestPlugin()] | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,8 @@ | ||
class MyPlugin { | ||
apply(compiler) { | ||
compiler.hooks.compilation.tap("MyPlugin", compilation => { | ||
const logger = compilation.getLogger("MyPlugin"); | ||
logger.group("Group"); | ||
logger.error("Error"); | ||
logger.warn("Warning"); | ||
logger.info("Info"); | ||
logger.log("Log"); | ||
logger.debug("Debug"); | ||
logger.groupCollapsed("Collaped group"); | ||
logger.log("Log inside collapsed group"); | ||
logger.groupEnd(); | ||
logger.groupEnd(); | ||
}); | ||
} | ||
} | ||
const LogTestPlugin = require("../../helpers/LogTestPlugin"); | ||
|
||
module.exports = { | ||
mode: "production", | ||
entry: "./index", | ||
stats: "minimal", | ||
plugins: [new MyPlugin()] | ||
plugins: [new LogTestPlugin()] | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,8 @@ | ||
class MyPlugin { | ||
apply(compiler) { | ||
compiler.hooks.compilation.tap("MyPlugin", compilation => { | ||
const logger = compilation.getLogger("MyPlugin"); | ||
logger.group("Group"); | ||
logger.error("Error"); | ||
logger.warn("Warning"); | ||
logger.info("Info"); | ||
logger.log("Log"); | ||
logger.debug("Debug"); | ||
logger.groupCollapsed("Collaped group"); | ||
logger.log("Log inside collapsed group"); | ||
logger.groupEnd(); | ||
logger.groupEnd(); | ||
}); | ||
} | ||
} | ||
const LogTestPlugin = require("../../helpers/LogTestPlugin"); | ||
|
||
module.exports = { | ||
mode: "production", | ||
entry: "./index", | ||
stats: false, | ||
plugins: [new MyPlugin()] | ||
plugins: [new LogTestPlugin()] | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,8 @@ | ||
class MyPlugin { | ||
apply(compiler) { | ||
compiler.hooks.compilation.tap("MyPlugin", compilation => { | ||
const logger = compilation.getLogger("MyPlugin"); | ||
logger.group("Group"); | ||
logger.error("Error"); | ||
logger.warn("Warning"); | ||
logger.info("Info"); | ||
logger.log("Log"); | ||
logger.debug("Debug"); | ||
logger.groupCollapsed("Collaped group"); | ||
logger.log("Log inside collapsed group"); | ||
logger.groupEnd(); | ||
logger.groupEnd(); | ||
}); | ||
} | ||
} | ||
const LogTestPlugin = require("../../helpers/LogTestPlugin"); | ||
|
||
module.exports = { | ||
mode: "production", | ||
entry: "./index", | ||
stats: "normal", | ||
plugins: [new MyPlugin()] | ||
plugins: [new LogTestPlugin()] | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,9 @@ | ||
class MyPlugin { | ||
apply(compiler) { | ||
compiler.hooks.compilation.tap("MyPlugin", compilation => { | ||
const logger = compilation.getLogger("MyPlugin"); | ||
logger.group("Group"); | ||
logger.error("Error"); | ||
logger.warn("Warning"); | ||
logger.info("Info"); | ||
logger.log("Log"); | ||
logger.debug("Debug"); | ||
logger.groupCollapsed("Collaped group"); | ||
logger.log("Log inside collapsed group"); | ||
logger.groupEnd(); | ||
logger.groupEnd(); | ||
}); | ||
} | ||
} | ||
const LogTestPlugin = require("../../helpers/LogTestPlugin"); | ||
|
||
module.exports = { | ||
mode: "production", | ||
entry: "./index", | ||
profile: true, | ||
stats: "verbose", | ||
plugins: [new MyPlugin()] | ||
plugins: [new LogTestPlugin()] | ||
}; |