-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
migrate to built-in logger #2563
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
* chore(deps): upgrade chokidar * chore(deps): switch to promise method without async for close * chore(ci): remove node v6 * chore(deps): fix issue of closing watchers before middleware * chore(deps): upgrade chokidar to v3.4.0
* chore(deps): upgrade deps * style: run prettier * test: update * ci: remove Node@8 * test(cli): add windows support * chore(deps): downgrade puppeteer * chore(deps): downgrade some deps * fix(hot): enable hot option as default (#2546) BREAKING CHANGE: the `hot` option is `true` by default, the `hotOnly` option was removed in favor `{ hot: 'only' }` * fix: remove lazy and filename options (#2544) BREAKING CHANGE: `lazy` and `filename` options was removed
Codecov Report
@@ Coverage Diff @@
## v4 #2563 +/- ##
==========================================
- Coverage 93.77% 93.49% -0.29%
==========================================
Files 34 34
Lines 1333 1275 -58
Branches 381 354 -27
==========================================
- Hits 1250 1192 -58
Misses 81 81
Partials 2 2
Continue to review full report at Codecov.
|
@@ -74,17 +74,12 @@ const options = { | |||
default: true, | |||
describe: 'Info', | |||
}, | |||
quiet: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Respect to infrastructurelogging.level.
'client-log-level': { | ||
type: 'string', | ||
group: DISPLAY_GROUP, | ||
default: 'info', | ||
describe: | ||
'Log level in the browser (trace, debug, info, warn, error or silent)', | ||
'Log level in the browser (none, error, warn, info, log, verbose)', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We've already talked about it and they should respect infrastructurelogging.level.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hm, in fact, client-log-level should respect infrastructurelogging.level? What do you think?
if (options.useWarningOverlay || options.useErrorOverlay) { | ||
overlay.clear(); | ||
} | ||
sendMessage('StillOk'); | ||
}, | ||
'log-level': function logLevel(level) { | ||
const hotCtx = require.context('webpack/hot', false, /^\.\/log$/); | ||
if (hotCtx.keys().indexOf('./log') !== -1) { | ||
hotCtx('./log').setLogLevel(level); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure but I think this is unnecessary. I've already checked that this log-level is applied to clientLogLevel which is from CLI flag.
test/cli/cli.test.js
Outdated
done: false, | ||
}, | ||
}; | ||
it('should use different random port when multiple instances are started on different processes', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test fails so I need to fix it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, this test in the master branch is broken as well...
cp1:null cp2: 8080
Yes this test passes because null !== 8080 but we don't expect it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've fixed this test.
3252e64
to
c2b23aa
Compare
@@ -38,13 +38,11 @@ if (!process.env.WEBPACK_DEV_SERVER) { | |||
} | |||
|
|||
class Server { | |||
constructor(compiler, options = {}, _log) { | |||
constructor(compiler, options = {}, log) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I remain log
for users who want to inject a custom logger.
c2b23aa
to
af1f64c
Compare
af1f64c
to
b6af4e9
Compare
DON'T MERGE but request maintainer's comments
For Bugs and Features; did you add new tests?
Yep
Motivation / Use-Case
We need to drop webpack-log because this package isn't under our management.
see https://www.npmjs.com/package/webpack-log
And webpack@4 supports
infrastructureLogging
system so I decided to migrate to it. See https://webpack.js.org/configuration/other-options/#infrastructurelogging.Output
Dropped keys (CLI as well)
Modified keys
debug
,trace
,silent
, andwarning
instead ofnone
,warn
andverbose
Breaking Changes
Yep
Additional Info
Currently, I don't know why but the CLI test of multi ports fails so I'm investigating it.