aws-cdk icon indicating copy to clipboard operation
aws-cdk copied to clipboard

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

Open HBobertz opened this issue 2 years ago • 3 comments

Describe the feature

This file defines our logging tools for the CDK CLI. Refactor the logging implementation into a single logging function which takes both a message and the logging type (info, debug, trace, error, etc...), and then additionally ensure any logging in the package uses this logging function.

Use Case

needed to support future CDK Programmatic Access, but also Centralizes and consolidates logging for the CLI.

Proposed Solution

Probably something like

export type LogLevel = 'error' | 'warn' | 'info' | 'debug' | 'trace';

export interface LogEntry = {
  level: LogLevel
  message: string
}

export function log(...args: LogEntry[]) {
  // do the stuff
}

Other Information

No response

Acknowledgements

  • [X] I may be able to implement this feature request
  • [ ] This feature might incur a breaking change

CDK version used

2.165

Environment details (OS name and version, etc.)

macOS 15 Sequoia

HBobertz avatar Nov 06 '24 18:11 HBobertz

Worked upon by CDK team.

ashishdhingra avatar Nov 06 '24 19:11 ashishdhingra

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[bot] avatar Nov 27 '24 18:11 github-actions[bot]

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[bot] avatar Nov 27 '24 18:11 github-actions[bot]