Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Move redux logging to a different file #10605

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

Merged
merged 7 commits into from
Mar 17, 2020
Merged

Move redux logging to a different file #10605

merged 7 commits into from
Mar 17, 2020

Conversation

rchiodo
Copy link

@rchiodo rchiodo commented Mar 17, 2020

Some of the nightly flake tests are failing and I can't repro on my local box. This change will move the logging for the react side into a separate file so I can see only what's happening in the extension.

The other log will still contain time stamps, so it should be possible to correlate it with the main extension log.

@rchiodo rchiodo self-assigned this Mar 17, 2020
@rchiodo rchiodo added the no-changelog No news entry required label Mar 17, 2020
@@ -120,6 +119,8 @@ function createSendInfoMiddleware(): Redux.Middleware<{}, IStore> {
function createTestLogger() {
const logFileEnv = process.env.VSC_PYTHON_WEBVIEW_LOG_FILE;
if (logFileEnv) {
// tslint:disable-next-line: no-require-imports
const log4js = require('log4js') as typeof import('log4js');

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will still get pulled into the final build.
We might want to make log4js a global like vscode in release mode build of the UI side of webpack. This way it won't get pulled into release bits.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We might want to make log4js a global like vscode in release mode build of the UI side of webpack.

How do I do that?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it this setting in the config?

externals: ['vscode', 'commonjs'],

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In webpack, we have a section externals: ['vscode', 'commonjs'..],
This is in the webpack.extension.config.js today.
We can add a similar setting to the webpack.datascience-ui.config.builder.js and if it is a release build (isProdBuild constant), then array contains ['log4js'] else empty array.
Same way gather is made an external package when building extension.

@codecov-io
Copy link

codecov-io commented Mar 17, 2020

Codecov Report

Merging #10605 into master will decrease coverage by 0.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #10605      +/-   ##
==========================================
- Coverage   60.79%   60.77%   -0.02%     
==========================================
  Files         579      579              
  Lines       31412    31412              
  Branches     4469     4469              
==========================================
- Hits        19097    19091       -6     
- Misses      11344    11348       +4     
- Partials      971      973       +2
Impacted Files Coverage Δ
src/datascience-ui/react-common/arePathsSame.ts 75% <0%> (-12.5%) ⬇️
src/client/common/utils/platform.ts 64.7% <0%> (-11.77%) ⬇️
src/client/linters/pydocstyle.ts 86.66% <0%> (-2.23%) ⬇️
src/client/datascience/debugLocationTracker.ts 76.56% <0%> (-1.57%) ⬇️
src/client/common/process/proc.ts 14.49% <0%> (-0.73%) ⬇️
...bugger/extension/configuration/resolvers/attach.ts 81.66% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 324824a...1046292. Read the comment docs.

@@ -190,6 +190,7 @@ function buildConfiguration(isNotebook) {
}),
...getPlugins(isNotebook)
],
externals: ['log4js'],

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yes, this will also work, i.e. unconditional.

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@rchiodo rchiodo merged commit c3e6ef7 into master Mar 17, 2020
@rchiodo rchiodo deleted the rchiodo/redux_log_move branch March 17, 2020 17:10
DonJayamanne added a commit that referenced this pull request Mar 17, 2020
* master:
  Move redux logging to a different file (#10605)
  Ensure local host only if connection not available (#10600)
  Fix a bunch of debugger issues (#10572)
  Bump acorn from 6.0.0 to 6.4.1 (#10570)
  Resize plot to fit within pdf page (#10547)
  Update dev build instructions to mention "python.insidersChannel"
  Install the ZMQ prebuilt binaries and verify ZMQ works on startup (#10551)
DonJayamanne added a commit that referenced this pull request Mar 17, 2020
* master:
  Fix merge issue
  Move redux logging to a different file (#10605)
  Disable custom editor API (#10604)
  Ensure local host only if connection not available (#10600)
  Delegate management of notebooks (creation and disposing) to I… (#10568)
  Refactor to accommodate upstream VSCode API changes (#10569)
  Use a single notebook beetween multiple native editors (#10514)
  Add support for synchronising edits between two nb editors of… (#10189)
  Fix tests in ds/custom_editor branch (#10512)
  Fix linter
  Reimplement custom editor using new API
@lock lock bot locked as resolved and limited conversation to collaborators Mar 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
no-changelog No news entry required
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants