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

feat: Allow setting log level #71

Merged
merged 1 commit into from
Feb 16, 2022
Merged

feat: Allow setting log level #71

merged 1 commit into from
Feb 16, 2022

Conversation

lawmicha
Copy link
Contributor

@lawmicha lawmicha commented Feb 15, 2022

Issue #, if available:
https://github.com/aws-amplify/aws-appsync-realtime-client-ios/issues/31

Description of changes:
Allow the logging level to be configurable allows the consumers of this package (API Plugin and AppSync SDK) to set it through its log level. In Amplify, when the developer sets Amplify.Logging.logLevel, this can be propagated to AppSyncRealTimeClient.logLevel when the plugins are configured. Since the intention is to propagate the log levels from Amplify, they are identical to the ones defined in Amplify.Logging category https://github.com/aws-amplify/amplify-ios/blob/main/Amplify/Categories/Logging/LogLevel.swift

enum LogLevel: Int {
        case error
        case warn
        case info
        case debug
        case verbose
    }
  • errors is the default log level (also is Amplify's)
  • the log level can be set with AppSyncRealTimeClient.logLevel = .verbose by developers after calling Amplify.configure if they are debugging and want the logLevels to be different from Amplify.Logging's logLevel, though i don't think this is a very common use case, as developers should just be operating on Amplify.Logging.logLevel

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

Copy link
Contributor

@royjit royjit left a comment

Choose a reason for hiding this comment

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

LGTM

@lawmicha lawmicha marked this pull request as ready for review February 16, 2022 16:41
@lawmicha lawmicha requested a review from a team February 16, 2022 16:41
@lawmicha lawmicha merged commit 1713da5 into main Feb 16, 2022
@lawmicha lawmicha deleted the feat/log-level branch February 16, 2022 16:42
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