Skip to content
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

fix: unable to apply logging format #14074

Merged
merged 2 commits into from
Apr 13, 2021
Merged

Conversation

zhaoyongjie
Copy link
Member

@zhaoyongjie zhaoyongjie commented Apr 11, 2021

SUMMARY

Now the Python logging formatter does not apply correctly. This is because there was already root logger hander before this code was executed.

logging.basicConfig(format=app_config["LOG_FORMAT"])
logging.getLogger().setLevel(app_config["LOG_LEVEL"])

There are two ways to solve this problem.

  1. Instance logger as early as possible
  2. add force argument to logging.basicConfig. https://docs.python.org/3/library/logging.html#logging.basicConfig

This PR uses the first.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Before

image

After

image

TEST PLAN

Tested in my local laptop.

ADDITIONAL INFORMATION

  • Has associated issue:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

@codecov
Copy link

codecov bot commented Apr 11, 2021

Codecov Report

Merging #14074 (58da404) into master (a4fd6b8) will increase coverage by 0.24%.
The diff coverage is 77.67%.

❗ Current head 58da404 differs from pull request most recent head 91996a5. Consider uploading reports for the commit 91996a5 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master   #14074      +/-   ##
==========================================
+ Coverage   79.30%   79.55%   +0.24%     
==========================================
  Files         939      942       +3     
  Lines       47541    47675     +134     
  Branches     5938     5980      +42     
==========================================
+ Hits        37703    37926     +223     
+ Misses       9717     9628      -89     
  Partials      121      121              
Flag Coverage Δ
cypress 56.32% <79.57%> (+2.08%) ⬆️
hive 80.45% <82.35%> (+<0.01%) ⬆️
mysql 80.72% <82.35%> (+<0.01%) ⬆️
postgres 80.75% <82.35%> (+<0.01%) ⬆️
presto 80.47% <82.35%> (+<0.01%) ⬆️
python 81.32% <82.35%> (+<0.01%) ⬆️
sqlite 80.35% <82.35%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...rset-frontend/src/components/ErrorMessage/types.ts 100.00% <ø> (ø)
...et-frontend/src/dashboard/actions/nativeFilters.ts 60.00% <ø> (ø)
...rontend/src/dashboard/components/DashboardGrid.jsx 89.47% <ø> (+19.29%) ⬆️
...ntend/src/dashboard/containers/DashboardHeader.jsx 100.00% <ø> (ø)
...nd/src/dashboard/util/activeAllDashboardFilters.ts 100.00% <ø> (ø)
.../src/explore/components/controls/SliderControl.jsx 57.14% <ø> (+12.69%) ⬆️
...tend/src/filters/components/Select/controlPanel.ts 18.18% <0.00%> (-1.82%) ⬇️
superset/reports/notifications/email.py 100.00% <ø> (ø)
superset/views/core.py 75.71% <0.00%> (+0.08%) ⬆️
...t-frontend/src/dashboard/actions/dashboardState.js 65.21% <10.00%> (-3.66%) ⬇️
... and 65 more

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 a4fd6b8...91996a5. Read the comment docs.

@zhaoyongjie zhaoyongjie requested a review from a team April 12, 2021 02:25
Copy link
Member

@etr2460 etr2460 left a comment

Choose a reason for hiding this comment

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

lgtm with one suggestion

superset/app.py Show resolved Hide resolved
Great!

Co-authored-by: Erik Ritter <erik.ritter@airbnb.com>
@zhaoyongjie zhaoyongjie merged commit 80da1ca into apache:master Apr 13, 2021
amitmiran137 pushed a commit that referenced this pull request Apr 13, 2021
* master:
  fix: unable to apply logging format (#14074)
  refactor: Bootstrap to AntD - Slider (#13989)
  chore(spa refactor): refactoring dashboard to use api's instead of bootstrapdata (#13306)
  fix(listview): update listview feature flag (#13906)
  Add docs for configuring Docker Compose setup (#13961)
  feat: invalid password error message (Postgres) (#14038)
  fix: flacky test in test_update_dataset_item_w_override_columns (#14082)
  feat: Implement Celery SoftTimeLimit handling (#13740)
  feat: only send alert error emails to owners of the alert (#13862)
  feat: add descriptions to report emails (#13827)
  Make chart exclude itself from cross filtering (#14046)
  fix: fix bug when remove chart not  removing it's related cross filter data (#14081)
  feat(native-filters): Add default first value to select filter (#13726)
  feat: Make async query JWT cookie domain configurable (#14007)
  fix: add exception to catch session not having JWT (#14036)

# Conflicts:
#	superset-frontend/src/dashboard/actions/hydrate.js
#	superset/views/core.py
amitmiran137 pushed a commit that referenced this pull request Apr 13, 2021
* master: (53 commits)
  test: Adds tests to the UndoRedoKeyListeners component (#13919)
  chore: Adds dataMask reducer to reducerIndex (#13951)
  test: Tests audit for the Dashboard FilterBar (#13916)
  fix: unable to apply logging format (#14074)
  refactor: Bootstrap to AntD - Slider (#13989)
  chore(spa refactor): refactoring dashboard to use api's instead of bootstrapdata (#13306)
  fix(listview): update listview feature flag (#13906)
  Add docs for configuring Docker Compose setup (#13961)
  feat: invalid password error message (Postgres) (#14038)
  fix: flacky test in test_update_dataset_item_w_override_columns (#14082)
  feat: Implement Celery SoftTimeLimit handling (#13740)
  feat: only send alert error emails to owners of the alert (#13862)
  feat: add descriptions to report emails (#13827)
  Make chart exclude itself from cross filtering (#14046)
  fix: fix bug when remove chart not  removing it's related cross filter data (#14081)
  feat(native-filters): Add default first value to select filter (#13726)
  feat: Make async query JWT cookie domain configurable (#14007)
  fix: add exception to catch session not having JWT (#14036)
  Use consistent chart value (#14031)
  fix: Use superset generic db to catch external_metadata queries (#13974)
  ...
allanco91 pushed a commit to allanco91/superset that referenced this pull request May 21, 2021
* fix: unable to apply logging format

* Update superset/app.py

Great!

Co-authored-by: Erik Ritter <erik.ritter@airbnb.com>

Co-authored-by: Erik Ritter <erik.ritter@airbnb.com>
QAlexBall pushed a commit to QAlexBall/superset that referenced this pull request Dec 29, 2021
* fix: unable to apply logging format

* Update superset/app.py

Great!

Co-authored-by: Erik Ritter <erik.ritter@airbnb.com>

Co-authored-by: Erik Ritter <erik.ritter@airbnb.com>
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 1.2.0 labels Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels size/XS 🚢 1.2.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants