aws-samples / eks-cluster-upgrade

Automated Amazon EKS cluster upgrade
MIT No Attribution
154 stars 35 forks source link

feat: Logger format update #82

Closed quixoticmonk closed 1 year ago

quixoticmonk commented 1 year ago

Summary

Changed the logging format to use timestamp and method line numbers to help with future debugging. Sample log lines below.

[INFO] : 2023-03-17 22:00:29 : botocore.credentials : Found credentials in environment variables.
[INFO] : 2023-03-17 22:00:30 : eksupgrade.src.preflight_module.91 : Cluster already upgraded to version 1.22

Resolves: #81

Changes

User experience

Before:

INFO:botocore.credentials:Found credentials in environment variables.
INFO:botocore.credentials:Found credentials in environment variables.
INFO:eksupgrade.src.preflight_module:Verifying User IAM Role....
INFO:eksupgrade.src.preflight_module:IAM role for user verified
INFO:botocore.credentials:Found credentials in environment variables.
INFO:eksupgrade.src.preflight_module:Fetching cluster details .....
INFO:eksupgrade.src.preflight_module:Cluster control plane version 1.22
INFO:eksupgrade.src.preflight_module:Cluster already upgraded to version 1.22

After:

[INFO] : 2023-03-17 22:00:29 : botocore.credentials : Found credentials in environment variables.
[INFO] : 2023-03-17 22:00:29 : botocore.credentials : Found credentials in environment variables.
[INFO] : 2023-03-17 22:00:29 : eksupgrade.src.preflight_module.40 : Verifying User IAM Role....
[INFO] : 2023-03-17 22:00:30 : eksupgrade.src.preflight_module.42 : IAM role for user verified
[INFO] : 2023-03-17 22:00:30 : botocore.credentials : Found credentials in environment variables.
[INFO] : 2023-03-17 22:00:30 : eksupgrade.src.preflight_module.79 : Fetching cluster details .....
[INFO] : 2023-03-17 22:00:30 : eksupgrade.src.preflight_module.87 : Cluster control plane version 1.22
[INFO] : 2023-03-17 22:00:30 : eksupgrade.src.preflight_module.91 : Cluster already upgraded to version 1.22

Checklist

If your change doesn't seem to apply, please leave them unchecked.

Acknowledgment

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.

codecov-commenter commented 1 year ago

Codecov Report

Patch coverage: 96.77% and project coverage change: +0.37 :tada:

Comparison is base (a88f478) 27.51% compared to head (a69bc4c) 27.88%.

:mega: This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #82 +/- ## ========================================== + Coverage 27.51% 27.88% +0.37% ========================================== Files 13 13 Lines 1912 1922 +10 ========================================== + Hits 526 536 +10 Misses 1386 1386 ``` | [Impacted Files](https://codecov.io/gh/aws-samples/eks-cluster-upgrade/pull/82?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None) | Coverage Δ | | |---|---|---| | [eksupgrade/cli.py](https://codecov.io/gh/aws-samples/eks-cluster-upgrade/pull/82?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-ZWtzdXBncmFkZS9jbGkucHk=) | `93.10% <66.66%> (+0.24%)` | :arrow_up: | | [eksupgrade/models/base.py](https://codecov.io/gh/aws-samples/eks-cluster-upgrade/pull/82?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-ZWtzdXBncmFkZS9tb2RlbHMvYmFzZS5weQ==) | `82.22% <100.00%> (ø)` | | | [eksupgrade/models/eks.py](https://codecov.io/gh/aws-samples/eks-cluster-upgrade/pull/82?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-ZWtzdXBncmFkZS9tb2RlbHMvZWtzLnB5) | `60.29% <100.00%> (ø)` | | | [eksupgrade/src/boto\_aws.py](https://codecov.io/gh/aws-samples/eks-cluster-upgrade/pull/82?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-ZWtzdXBncmFkZS9zcmMvYm90b19hd3MucHk=) | `10.84% <100.00%> (ø)` | | | [eksupgrade/src/eks\_get\_image\_type.py](https://codecov.io/gh/aws-samples/eks-cluster-upgrade/pull/82?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-ZWtzdXBncmFkZS9zcmMvZWtzX2dldF9pbWFnZV90eXBlLnB5) | `14.54% <100.00%> (ø)` | | | [eksupgrade/src/k8s\_client.py](https://codecov.io/gh/aws-samples/eks-cluster-upgrade/pull/82?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-ZWtzdXBncmFkZS9zcmMvazhzX2NsaWVudC5weQ==) | `28.18% <100.00%> (-0.33%)` | :arrow_down: | | [eksupgrade/src/latest\_ami.py](https://codecov.io/gh/aws-samples/eks-cluster-upgrade/pull/82?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-ZWtzdXBncmFkZS9zcmMvbGF0ZXN0X2FtaS5weQ==) | `19.23% <100.00%> (ø)` | | | [eksupgrade/src/preflight\_module.py](https://codecov.io/gh/aws-samples/eks-cluster-upgrade/pull/82?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-ZWtzdXBncmFkZS9zcmMvcHJlZmxpZ2h0X21vZHVsZS5weQ==) | `4.40% <100.00%> (ø)` | | | [eksupgrade/src/self\_managed.py](https://codecov.io/gh/aws-samples/eks-cluster-upgrade/pull/82?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-ZWtzdXBncmFkZS9zcmMvc2VsZl9tYW5hZ2VkLnB5) | `16.00% <100.00%> (ø)` | | | [eksupgrade/starter.py](https://codecov.io/gh/aws-samples/eks-cluster-upgrade/pull/82?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-ZWtzdXBncmFkZS9zdGFydGVyLnB5) | `13.33% <100.00%> (ø)` | | | ... and [1 more](https://codecov.io/gh/aws-samples/eks-cluster-upgrade/pull/82?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None) | | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.