8000 refactor: dynamic prefix for subcommand loggers by jhoward-lm · Pull Request #138 · bomctl/bomctl · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

refactor: dynamic prefix fo 8000 r subcommand loggers #138

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

Merged
merged 1 commit into from
Aug 22, 2024

Conversation

jhoward-lm
Copy link
Contributor

Description

This PR includes a small refactor to use a dynamic prefix when creating a subcommand's logger, and only call the logger instantiation from a single location in rootCmd instead of from every subcommand.

The intent is to use the first top-level subcommand's name in cases where a subcommand may have more than one nested subcommand (e.g. bomctl alias remove ..., in which case the logger prefix will be alias: instead of remove:).

Type of change

  • Refactor

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • I have checked my code and corrected any misspellings

Signed-off-by: Jonathan Howard <jonathan.w.howard@lmco.com>
@jhoward-lm jhoward-lm added the enhancement New feature or request label Aug 22, 2024
@jhoward-lm jhoward-lm self-assigned this Aug 22, 2024
@jhoward-lm jhoward-lm requested a review from a team as a code owner August 22, 2024 14:04
Copy link
Member
@ashearin ashearin left a comment

Choose a reason for hiding this comment

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

Awesome!

@idunbarh idunbarh merged commit 871c2d1 into main Aug 22, 2024
9 checks passed
@idunbarh idunbarh deleted the logger-dynamic-prefix branch August 22, 2024 14:53
838F
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants
0