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

use unified root logger for fx dependency-injection in chaos-controller-manager #2808

Merged

Conversation

STRRL
Copy link
Member

@STRRL STRRL commented Jan 20, 2022

What problem does this PR solve?

It's a part of #2752.

What's changed and how it works?

  • use a certain logr.Logger for both controller-runtime and fx

Related changes

  • Need to update chaos-mesh/website
  • Need to update Dashboard UI
  • Need to cheery-pick to release branches
    • release-2.1
    • release-2.0

Checklist

Tests

  • Unit test
  • E2E test
  • No code
  • Manual test (add steps below)

Side effects

  • Breaking backward compatibility

Release note

Please add a release note.

You can safely ignore this section if you don't think this PR needs a release note.

DCO

If you find the DCO check fails, please run commands like below (Depends on the actual situations. For example, if the failed commit isn't the most recent) to fix it:

git commit --amend --signoff
git push --force

Signed-off-by: STRRL <str_ruiling@outlook.com>
Signed-off-by: STRRL <str_ruiling@outlook.com>
@ti-chi-bot
Copy link
Member

ti-chi-bot commented Jan 20, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • Andrewmatilde
  • iguoyr

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@STRRL STRRL changed the title [WIP]: use unified root logger for chaos-controller-manager [WIP]: use unified root logger for fx dependency-injection in chaos-controller-manager Jan 20, 2022
Signed-off-by: STRRL <str_ruiling@outlook.com>
@STRRL STRRL mentioned this pull request Jan 21, 2022
30 tasks
@codecov
Copy link

codecov bot commented Jan 21, 2022

Codecov Report

Merging #2808 (a5c36ae) into master (0a96a2a) will decrease coverage by 0.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2808      +/-   ##
==========================================
- Coverage   40.96%   40.94%   -0.02%     
==========================================
  Files         147      147              
  Lines       11985    11983       -2     
==========================================
- Hits         4910     4907       -3     
- Misses       6705     6708       +3     
+ Partials      370      368       -2     
Impacted Files Coverage Δ
...md/chaos-controller-manager/provider/controller.go 38.79% <ø> (-1.04%) ⬇️
.../workflow/controllers/workflow_entry_reconciler.go 46.03% <0.00%> (-6.88%) ⬇️
pkg/selector/generic/mode.go 25.64% <0.00%> (-2.57%) ⬇️
api/v1alpha1/zz_generated.chaosmesh.go 57.64% <0.00%> (ø)
pkg/workflow/controllers/serial_node_reconciler.go 60.73% <0.00%> (+1.57%) ⬆️
pkg/workflow/controllers/chaos_node_reconciler.go 61.31% <0.00%> (+3.15%) ⬆️

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 712f58c...a5c36ae. Read the comment docs.

Signed-off-by: STRRL <str_ruiling@outlook.com>
Signed-off-by: STRRL <str_ruiling@outlook.com>
Signed-off-by: STRRL <str_ruiling@outlook.com>
@STRRL STRRL changed the title [WIP]: use unified root logger for fx dependency-injection in chaos-controller-manager use unified root logger for fx dependency-injection in chaos-controller-manager Feb 7, 2022
@STRRL STRRL marked this pull request as ready for review February 7, 2022 05:58
@STRRL
Copy link
Member Author

STRRL commented Feb 7, 2022

PTAL

/cc @iguoyr @WangXiangUSTC @YangKeao

return result
}

// ReplaceGlobals would replace the global logger with the given logger.
Copy link
Member

Choose a reason for hiding this comment

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

Add some comments about this function should only be called when application starting?

Copy link
Member Author

Choose a reason for hiding this comment

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

How about "should be called when application starting" ?🤔 I think this restriction ("should only be") is not necessary.

Copy link
Member

Choose a reason for hiding this comment

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

Agree with you :)

Copy link
Member Author

Choose a reason for hiding this comment

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

Updated, PTAL!

Signed-off-by: STRRL <str_ruiling@outlook.com>
Copy link
Member

@iguoyr iguoyr left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@Andrewmatilde Andrewmatilde left a comment

Choose a reason for hiding this comment

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

LGTM. Need example in future.

@STRRL
Copy link
Member Author

STRRL commented Feb 8, 2022

/merge

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: f87e4d7

@STRRL
Copy link
Member Author

STRRL commented Feb 9, 2022

/merge

Signed-off-by: STRRL <str_ruiling@outlook.com>
@STRRL
Copy link
Member Author

STRRL commented Feb 9, 2022

/merge

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: a5c36ae

@ti-chi-bot ti-chi-bot merged commit 149e540 into chaos-mesh:master Feb 9, 2022
@ti-srebot
Copy link
Contributor

cherry pick to release-2.1 failed

@STRRL
Copy link
Member Author

STRRL commented Feb 9, 2022

cherry pick to release-2.1 failed

I would manually cherry pick it.

STRRL added a commit to STRRL/chaos-mesh that referenced this pull request Mar 3, 2022
…er-manager (chaos-mesh#2808)

* chore: package for logger

Signed-off-by: STRRL <str_ruiling@outlook.com>

* chore: fix dependency injection

Signed-off-by: STRRL <str_ruiling@outlook.com>

* chore: update comments for global logger L

Signed-off-by: STRRL <str_ruiling@outlook.com>

* chore: use standard log instead of fmt.Print

Signed-off-by: STRRL <str_ruiling@outlook.com>

* chore: configure logger for fx

Signed-off-by: STRRL <str_ruiling@outlook.com>

* chore: make check

Signed-off-by: STRRL <str_ruiling@outlook.com>

* chore: update comments for ReplaceGlobals

Signed-off-by: STRRL <str_ruiling@outlook.com>

* chore: make check

Signed-off-by: STRRL <str_ruiling@outlook.com>

Co-authored-by: Ti Chi Robot <ti-community-prow-bot@tidb.io>
ti-chi-bot added a commit that referenced this pull request Mar 7, 2022
* use unified root logger for fx dependency-injection in chaos-controller-manager (#2808)

* chore: package for logger

Signed-off-by: STRRL <str_ruiling@outlook.com>

* chore: fix dependency injection

Signed-off-by: STRRL <str_ruiling@outlook.com>

* chore: update comments for global logger L

Signed-off-by: STRRL <str_ruiling@outlook.com>

* chore: use standard log instead of fmt.Print

Signed-off-by: STRRL <str_ruiling@outlook.com>

* chore: configure logger for fx

Signed-off-by: STRRL <str_ruiling@outlook.com>

* chore: make check

Signed-off-by: STRRL <str_ruiling@outlook.com>

* chore: update comments for ReplaceGlobals

Signed-off-by: STRRL <str_ruiling@outlook.com>

* chore: make check

Signed-off-by: STRRL <str_ruiling@outlook.com>

Co-authored-by: Ti Chi Robot <ti-community-prow-bot@tidb.io>

* chore: make check

Signed-off-by: STRRL <str_ruiling@outlook.com>

Co-authored-by: Ti Chi Robot <ti-community-prow-bot@tidb.io>
STRRL added a commit to STRRL/chaos-mesh that referenced this pull request Mar 8, 2022
* use unified root logger for fx dependency-injection in chaos-controller-manager (chaos-mesh#2808)

* chore: package for logger

Signed-off-by: STRRL <str_ruiling@outlook.com>

* chore: fix dependency injection

Signed-off-by: STRRL <str_ruiling@outlook.com>

* chore: update comments for global logger L

Signed-off-by: STRRL <str_ruiling@outlook.com>

* chore: use standard log instead of fmt.Print

Signed-off-by: STRRL <str_ruiling@outlook.com>

* chore: configure logger for fx

Signed-off-by: STRRL <str_ruiling@outlook.com>

* chore: make check

Signed-off-by: STRRL <str_ruiling@outlook.com>

* chore: update comments for ReplaceGlobals

Signed-off-by: STRRL <str_ruiling@outlook.com>

* chore: make check

Signed-off-by: STRRL <str_ruiling@outlook.com>

Co-authored-by: Ti Chi Robot <ti-community-prow-bot@tidb.io>

* chore: make check

Signed-off-by: STRRL <str_ruiling@outlook.com>

Co-authored-by: Ti Chi Robot <ti-community-prow-bot@tidb.io>
Signed-off-by: STRRL <str_ruiling@outlook.com>
ti-chi-bot added a commit that referenced this pull request Mar 18, 2022
* cherry-pick logging updates into release-2.1 (#2970)

* use unified root logger for fx dependency-injection in chaos-controller-manager (#2808)

* chore: package for logger

Signed-off-by: STRRL <str_ruiling@outlook.com>

* chore: fix dependency injection

Signed-off-by: STRRL <str_ruiling@outlook.com>

* chore: update comments for global logger L

Signed-off-by: STRRL <str_ruiling@outlook.com>

* chore: use standard log instead of fmt.Print

Signed-off-by: STRRL <str_ruiling@outlook.com>

* chore: configure logger for fx

Signed-off-by: STRRL <str_ruiling@outlook.com>

* chore: make check

Signed-off-by: STRRL <str_ruiling@outlook.com>

* chore: update comments for ReplaceGlobals

Signed-off-by: STRRL <str_ruiling@outlook.com>

* chore: make check

Signed-off-by: STRRL <str_ruiling@outlook.com>

Co-authored-by: Ti Chi Robot <ti-community-prow-bot@tidb.io>

* chore: make check

Signed-off-by: STRRL <str_ruiling@outlook.com>

Co-authored-by: Ti Chi Robot <ti-community-prow-bot@tidb.io>
Signed-off-by: STRRL <str_ruiling@outlook.com>

* log: add customized logger for daemon and bpm (#2902)

* add customized logger for daemon and bpm

Signed-off-by: YangKeao <yangkeao@chunibyo.icu>

* extract the grpc metadata into the context

Signed-off-by: YangKeao <yangkeao@chunibyo.icu>

* make check

Signed-off-by: YangKeao <yangkeao@chunibyo.icu>

* make check

Signed-off-by: YangKeao <yangkeao@chunibyo.icu>

* remove log parameter in killIOChaos

Signed-off-by: YangKeao <yangkeao@chunibyo.icu>

* add logs

Signed-off-by: YangKeao <yangkeao@chunibyo.icu>

* remove log parameter in httpchaos server

Signed-off-by: YangKeao <yangkeao@chunibyo.icu>

* add the context comments for process builder

Signed-off-by: YangKeao <yangkeao@chunibyo.icu>

* make check

Signed-off-by: YangKeao <yangkeao@chunibyo.icu>

* use the logger in arguments

Signed-off-by: YangKeao <yangkeao@chunibyo.icu>

* add back boilerplate

Signed-off-by: YangKeao <yangkeao@chunibyo.icu>

* fix make check

Signed-off-by: YangKeao <yangkeao@chunibyo.icu>
Signed-off-by: STRRL <str_ruiling@outlook.com>

* remove unused logger in ProcessBuilder

Signed-off-by: STRRL <str_ruiling@outlook.com>

* chore: make check

Signed-off-by: STRRL <str_ruiling@outlook.com>

* chore: update changelog

Signed-off-by: STRRL <str_ruiling@outlook.com>

* retrigger lift

Signed-off-by: STRRL <str_ruiling@outlook.com>

Co-authored-by: Ti Chi Robot <ti-community-prow-bot@tidb.io>
Co-authored-by: YangKeao <yangkeao@chunibyo.icu>
zhqqqy pushed a commit to zhqqqy/chaos-mesh that referenced this pull request Apr 10, 2022
…er-manager (chaos-mesh#2808)

* chore: package for logger

Signed-off-by: STRRL <str_ruiling@outlook.com>

* chore: fix dependency injection

Signed-off-by: STRRL <str_ruiling@outlook.com>

* chore: update comments for global logger L

Signed-off-by: STRRL <str_ruiling@outlook.com>

* chore: use standard log instead of fmt.Print

Signed-off-by: STRRL <str_ruiling@outlook.com>

* chore: configure logger for fx

Signed-off-by: STRRL <str_ruiling@outlook.com>

* chore: make check

Signed-off-by: STRRL <str_ruiling@outlook.com>

* chore: update comments for ReplaceGlobals

Signed-off-by: STRRL <str_ruiling@outlook.com>

* chore: make check

Signed-off-by: STRRL <str_ruiling@outlook.com>

Co-authored-by: Ti Chi Robot <ti-community-prow-bot@tidb.io>
Signed-off-by: zhqqqy <zhqqqy@163.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants