-
Notifications
You must be signed in to change notification settings - Fork 273
Change debug/warn logs to info #5058
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
Changes from 3 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
c45b50f
change log to info
samgst-amazon bf6e470
Merge branch 'main' into samgst/DebugLogsToInfo
samgst-amazon bc44502
Merge branch 'main' into samgst/DebugLogsToInfo
samgst-amazon 8e7d7e3
lazyLog
samgst-amazon 0380e57
Merge branch 'main' into samgst/DebugLogsToInfo
samgst-amazon File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,7 +22,6 @@ | |
| import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper | ||
| import com.fasterxml.jackson.module.kotlin.readValue | ||
| import software.aws.toolkits.core.utils.createParentDirectories | ||
| import software.aws.toolkits.core.utils.debug | ||
| import software.aws.toolkits.core.utils.deleteIfExists | ||
| import software.aws.toolkits.core.utils.getLogger | ||
| import software.aws.toolkits.core.utils.inputStreamIfExists | ||
|
|
@@ -32,7 +31,6 @@ | |
| import software.aws.toolkits.core.utils.tryDirOp | ||
| import software.aws.toolkits.core.utils.tryFileOp | ||
| import software.aws.toolkits.core.utils.tryOrNull | ||
| import software.aws.toolkits.core.utils.warn | ||
| import software.aws.toolkits.telemetry.AuthTelemetry | ||
| import software.aws.toolkits.telemetry.Result | ||
| import java.io.InputStream | ||
|
|
@@ -97,16 +95,16 @@ | |
| } | ||
|
|
||
| override fun invalidateClientRegistration(ssoRegion: String) { | ||
| LOG.debug { "invalidateClientRegistration for $ssoRegion" } | ||
| LOG.info("invalidateClientRegistration for $ssoRegion") | ||
| clientRegistrationCache(ssoRegion).tryDeleteIfExists() | ||
| } | ||
|
|
||
| override fun loadClientRegistration(cacheKey: ClientRegistrationCacheKey): ClientRegistration? { | ||
| LOG.debug { "loadClientRegistration for $cacheKey" } | ||
| LOG.info("loadClientRegistration for $cacheKey") | ||
|
||
| val inputStream = clientRegistrationCache(cacheKey).tryInputStreamIfExists() | ||
| if (inputStream == null) { | ||
| val stage = LoadCredentialStage.ACCESS_FILE | ||
| LOG.warn { "Failed to load Client Registration: cache file does not exist" } | ||
| LOG.info("Failed to load Client Registration: cache file does not exist") | ||
| AuthTelemetry.modifyConnection( | ||
| action = "Load cache file", | ||
| source = "loadClientRegistration", | ||
|
|
@@ -120,15 +118,15 @@ | |
| } | ||
|
|
||
| override fun saveClientRegistration(cacheKey: ClientRegistrationCacheKey, registration: ClientRegistration) { | ||
| LOG.debug { "saveClientRegistration for $cacheKey" } | ||
| LOG.info("saveClientRegistration for $cacheKey") | ||
| val registrationCache = clientRegistrationCache(cacheKey) | ||
| writeKey(registrationCache) { | ||
| objectMapper.writeValue(it, registration) | ||
| } | ||
| } | ||
|
|
||
| override fun invalidateClientRegistration(cacheKey: ClientRegistrationCacheKey) { | ||
| LOG.debug { "invalidateClientRegistration for $cacheKey" } | ||
| LOG.info("invalidateClientRegistration for $cacheKey") | ||
|
||
| try { | ||
| clientRegistrationCache(cacheKey).tryDeleteIfExists() | ||
| } catch (e: Exception) { | ||
|
|
@@ -144,7 +142,7 @@ | |
| } | ||
|
|
||
| override fun invalidateAccessToken(ssoUrl: String) { | ||
| LOG.debug { "invalidateAccessToken for $ssoUrl" } | ||
| LOG.info("invalidateAccessToken for $ssoUrl") | ||
|
||
| try { | ||
| accessTokenCache(ssoUrl).tryDeleteIfExists() | ||
| } catch (e: Exception) { | ||
|
|
@@ -160,7 +158,7 @@ | |
| } | ||
|
|
||
| override fun loadAccessToken(cacheKey: AccessTokenCacheKey): AccessToken? { | ||
| LOG.debug { "loadAccessToken for $cacheKey" } | ||
| LOG.info("loadAccessToken for $cacheKey") | ||
| val cacheFile = accessTokenCache(cacheKey) | ||
| val inputStream = cacheFile.tryInputStreamIfExists() ?: return null | ||
|
|
||
|
|
@@ -170,15 +168,15 @@ | |
| } | ||
|
|
||
| override fun saveAccessToken(cacheKey: AccessTokenCacheKey, accessToken: AccessToken) { | ||
| LOG.debug { "saveAccessToken for $cacheKey" } | ||
| LOG.info("saveAccessToken for $cacheKey") | ||
| val accessTokenCache = accessTokenCache(cacheKey) | ||
| writeKey(accessTokenCache) { | ||
| objectMapper.writeValue(it, accessToken) | ||
| } | ||
| } | ||
|
|
||
| override fun invalidateAccessToken(cacheKey: AccessTokenCacheKey) { | ||
| LOG.debug { "invalidateAccessToken for $cacheKey" } | ||
| LOG.info("invalidateAccessToken for $cacheKey") | ||
|
||
| try { | ||
| accessTokenCache(cacheKey).tryDeleteIfExists() | ||
| } catch (e: Exception) { | ||
|
|
@@ -203,7 +201,7 @@ | |
| val sha = sha1(cacheNameMapper.writeValueAsString(it)) | ||
|
|
||
| cacheDir.resolve("$sha.json").also { | ||
| LOG.debug { "$cacheKey resolves to $it" } | ||
| LOG.info("$cacheKey resolves to $it") | ||
|
Check notice on line 204 in plugins/core/jetbrains-community/src/software/aws/toolkits/jetbrains/core/credentials/sso/DiskCache.kt
|
||
|
||
| } | ||
| } | ||
|
|
||
|
|
@@ -225,7 +223,7 @@ | |
| if (clientRegistration.expiresAt.isNotExpired()) { | ||
| return clientRegistration | ||
| } else { | ||
| LOG.warn { "Client Registration is expired" } | ||
| LOG.info("Client Registration is expired") | ||
| AuthTelemetry.modifyConnection( | ||
| action = "Validate Credentials", | ||
| source = "loadClientRegistration", | ||
|
|
@@ -236,7 +234,7 @@ | |
| return null | ||
| } | ||
| } catch (e: Exception) { | ||
| LOG.warn { "Client Registration could not be read" } | ||
| LOG.info("Client Registration could not be read") | ||
| AuthTelemetry.modifyConnection( | ||
| action = "Validate Credentials", | ||
| source = "loadClientRegistration", | ||
|
|
@@ -269,7 +267,7 @@ | |
| } | ||
|
|
||
| private fun writeKey(path: Path, consumer: (OutputStream) -> Unit) { | ||
| LOG.debug { "writing to $path" } | ||
| LOG.info("writing to $path") | ||
| try { | ||
| path.tryDirOp(LOG) { createParentDirectories() } | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.