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

chore: change logging to use a single base logging method #32081

Merged
merged 20 commits into from
Nov 27, 2024
Merged

Conversation

HBobertz
Copy link
Contributor

@HBobertz HBobertz commented Nov 11, 2024

Closes #32039

Modified the existing logging mechanism to route to a single log function. Adapted the existing structure so that very minimal changes were required for existing logging functions and how they are used today


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@aws-cdk-automation aws-cdk-automation requested a review from a team November 11, 2024 05:02
@github-actions github-actions bot added the p2 label Nov 11, 2024
@mergify mergify bot added the contribution/core This is a PR that came from AWS. label Nov 11, 2024
@github-actions github-actions bot added effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. labels Nov 11, 2024
Copy link
Collaborator

@aws-cdk-automation aws-cdk-automation left a comment

Choose a reason for hiding this comment

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

The pull request linter has failed. See the aws-cdk-automation comment below for failure reasons. If you believe this pull request should receive an exemption, please comment and provide a justification.

A comment requesting an exemption should contain the text Exemption Request. Additionally, if clarification is needed add Clarification Request to a comment.

@aws-cdk-automation aws-cdk-automation added the pr/needs-cli-test-run This PR needs CLI tests run against it. label Nov 11, 2024
Copy link

codecov bot commented Nov 12, 2024

Codecov Report

Attention: Patch coverage is 97.05882% with 2 lines in your changes missing coverage. Please review.

Project coverage is 78.19%. Comparing base (be000a2) to head (237e74d).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #32081      +/-   ##
==========================================
+ Coverage   77.46%   78.19%   +0.72%     
==========================================
  Files         105      105              
  Lines        7168     7176       +8     
  Branches     1314     1318       +4     
==========================================
+ Hits         5553     5611      +58     
+ Misses       1433     1377      -56     
- Partials      182      188       +6     
Flag Coverage Δ
suite.unit 78.19% <97.05%> (+0.72%) ⬆️

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

Components Coverage Δ
packages/aws-cdk 78.19% <97.05%> (+0.72%) ⬆️

@HBobertz HBobertz marked this pull request as ready for review November 12, 2024 14:46
@HBobertz HBobertz requested a review from a team as a code owner November 22, 2024 04:07
@aws-cdk-automation aws-cdk-automation dismissed their stale review November 25, 2024 20:06

✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.

@aws-cdk-automation aws-cdk-automation added the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Nov 25, 2024
@@ -49,7 +49,7 @@ export async function exec(args: string[], synthesizer?: Synthesizer): Promise<n
const argv = await parseCommandLineArguments(args, makeBrowserDefault(), await availableInitLanguages(), MIGRATE_SUPPORTED_LANGUAGES as string[], version.DISPLAY_VERSION, yargsNegativeAlias);

if (argv.verbose) {
setLogLevel(argv.verbose);
setLogLevelByValue(argv.verbose+2);
Copy link
Contributor

Choose a reason for hiding this comment

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

That's unexepected. If intentional it needs a comment why.

@@ -674,8 +674,7 @@ export class CurrentActivityPrinter extends ActivityPrinterBase {
public start() {
// Need to prevent the waiter from printing 'stack not stable' every 5 seconds, it messes
// with the output calculations.
this.oldLogLevel = logLevel;
setLogLevel(LogLevel.DEFAULT);
setLogLevel(LogLevel.INFO);
Copy link
Contributor

Choose a reason for hiding this comment

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

okay for now but we will need to get rid of this eventually. setLogLevel should only every be set once as it affects the output. These messages just need to be logged with the correct level (or not at all).

Copy link
Contributor

@mrgrain mrgrain left a comment

Choose a reason for hiding this comment

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

1 small request. Otherwise the build is not passing.

@aws-cdk-automation aws-cdk-automation removed the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Nov 27, 2024
Comment on lines +51 to +52
// if one -v, log at a DEBUG level
// if 2 -v, log at a TRACE level
Copy link
Contributor

Choose a reason for hiding this comment

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

What about -vvv

Suggested change
// if one -v, log at a DEBUG level
// if 2 -v, log at a TRACE level
// if -v, log at a DEBUG level
// if -vv, log at a TRACE level

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: 237e74d
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

Copy link
Contributor

mergify bot commented Nov 27, 2024

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@mergify mergify bot merged commit 069b72c into main Nov 27, 2024
17 of 18 checks passed
@mergify mergify bot deleted the bobertzh/logging branch November 27, 2024 18:07
Copy link

Comments on closed issues and PRs are hard for our team to see.
If you need help, please open a new issue that references this one.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 27, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
contribution/core This is a PR that came from AWS. effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2 pr-linter/cli-integ-tested Assert that any CLI changes have been integ tested
Projects
None yet
Development

Successfully merging this pull request may close these issues.

(aws-cdk): centralize all cli logging into a single logging function
3 participants