Skip to content

feat: Add disableLogging option to getManagementToken #770

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

lewisjcs
Copy link

This PR addresses issue #769 by adding a disableLogging option to the getManagementToken function, allowing users to programmatically suppress the internal logging performed by this function.

Changes:

  • Added disableLogging?: boolean to GetManagementTokenOptions.
  • Updated internal logic to respect the disableLogging flag.
  • Added unit tests to verify the new option.

@lewisjcs lewisjcs requested review from a team as code owners April 15, 2025 19:43
@@ -107,10 +108,10 @@ export const createGetManagementToken = (
const appToken = generateOneTimeToken(
privateKey,
{ appId: opts.appInstallationId, keyId: opts.keyId },
{ log },
{ log, disableLogging },
Copy link
Contributor

@BobHemphill76 BobHemphill76 Apr 15, 2025

Choose a reason for hiding this comment

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

wouldn't it be better to just pass in a logger that is a closure that uses disableLogging, rather than have to check for disable logging every time you want to log?

@lewisjcs lewisjcs force-pushed the feat/disable-logging-option branch from a63ccf5 to 16f9db0 Compare April 16, 2025 17:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants