Skip to content

Commit c45b50f

Browse files
committed
change log to info
1 parent 06181dd commit c45b50f

File tree

2 files changed

+14
-16
lines changed

2 files changed

+14
-16
lines changed

plugins/core/jetbrains-community/src/software/aws/toolkits/jetbrains/core/credentials/sso/DiskCache.kt

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule
2222
import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper
2323
import com.fasterxml.jackson.module.kotlin.readValue
2424
import software.aws.toolkits.core.utils.createParentDirectories
25-
import software.aws.toolkits.core.utils.debug
2625
import software.aws.toolkits.core.utils.deleteIfExists
2726
import software.aws.toolkits.core.utils.getLogger
2827
import software.aws.toolkits.core.utils.inputStreamIfExists
@@ -32,7 +31,6 @@ import software.aws.toolkits.core.utils.touch
3231
import software.aws.toolkits.core.utils.tryDirOp
3332
import software.aws.toolkits.core.utils.tryFileOp
3433
import software.aws.toolkits.core.utils.tryOrNull
35-
import software.aws.toolkits.core.utils.warn
3634
import software.aws.toolkits.telemetry.AuthTelemetry
3735
import software.aws.toolkits.telemetry.Result
3836
import java.io.InputStream
@@ -97,16 +95,16 @@ class DiskCache(
9795
}
9896

9997
override fun invalidateClientRegistration(ssoRegion: String) {
100-
LOG.debug { "invalidateClientRegistration for $ssoRegion" }
98+
LOG.info("invalidateClientRegistration for $ssoRegion")
10199
clientRegistrationCache(ssoRegion).tryDeleteIfExists()
102100
}
103101

104102
override fun loadClientRegistration(cacheKey: ClientRegistrationCacheKey): ClientRegistration? {
105-
LOG.debug { "loadClientRegistration for $cacheKey" }
103+
LOG.info("loadClientRegistration for $cacheKey")
106104
val inputStream = clientRegistrationCache(cacheKey).tryInputStreamIfExists()
107105
if (inputStream == null) {
108106
val stage = LoadCredentialStage.ACCESS_FILE
109-
LOG.warn { "Failed to load Client Registration: cache file does not exist" }
107+
LOG.info("Failed to load Client Registration: cache file does not exist")
110108
AuthTelemetry.modifyConnection(
111109
action = "Load cache file",
112110
source = "loadClientRegistration",
@@ -120,15 +118,15 @@ class DiskCache(
120118
}
121119

122120
override fun saveClientRegistration(cacheKey: ClientRegistrationCacheKey, registration: ClientRegistration) {
123-
LOG.debug { "saveClientRegistration for $cacheKey" }
121+
LOG.info("saveClientRegistration for $cacheKey")
124122
val registrationCache = clientRegistrationCache(cacheKey)
125123
writeKey(registrationCache) {
126124
objectMapper.writeValue(it, registration)
127125
}
128126
}
129127

130128
override fun invalidateClientRegistration(cacheKey: ClientRegistrationCacheKey) {
131-
LOG.debug { "invalidateClientRegistration for $cacheKey" }
129+
LOG.info("invalidateClientRegistration for $cacheKey")
132130
try {
133131
clientRegistrationCache(cacheKey).tryDeleteIfExists()
134132
} catch (e: Exception) {
@@ -144,7 +142,7 @@ class DiskCache(
144142
}
145143

146144
override fun invalidateAccessToken(ssoUrl: String) {
147-
LOG.debug { "invalidateAccessToken for $ssoUrl" }
145+
LOG.info("invalidateAccessToken for $ssoUrl")
148146
try {
149147
accessTokenCache(ssoUrl).tryDeleteIfExists()
150148
} catch (e: Exception) {
@@ -160,7 +158,7 @@ class DiskCache(
160158
}
161159

162160
override fun loadAccessToken(cacheKey: AccessTokenCacheKey): AccessToken? {
163-
LOG.debug { "loadAccessToken for $cacheKey" }
161+
LOG.info("loadAccessToken for $cacheKey")
164162
val cacheFile = accessTokenCache(cacheKey)
165163
val inputStream = cacheFile.tryInputStreamIfExists() ?: return null
166164

@@ -170,15 +168,15 @@ class DiskCache(
170168
}
171169

172170
override fun saveAccessToken(cacheKey: AccessTokenCacheKey, accessToken: AccessToken) {
173-
LOG.debug { "saveAccessToken for $cacheKey" }
171+
LOG.info("saveAccessToken for $cacheKey")
174172
val accessTokenCache = accessTokenCache(cacheKey)
175173
writeKey(accessTokenCache) {
176174
objectMapper.writeValue(it, accessToken)
177175
}
178176
}
179177

180178
override fun invalidateAccessToken(cacheKey: AccessTokenCacheKey) {
181-
LOG.debug { "invalidateAccessToken for $cacheKey" }
179+
LOG.info("invalidateAccessToken for $cacheKey")
182180
try {
183181
accessTokenCache(cacheKey).tryDeleteIfExists()
184182
} catch (e: Exception) {
@@ -203,7 +201,7 @@ class DiskCache(
203201
val sha = sha1(cacheNameMapper.writeValueAsString(it))
204202

205203
cacheDir.resolve("$sha.json").also {
206-
LOG.debug { "$cacheKey resolves to $it" }
204+
LOG.info("$cacheKey resolves to $it")
207205
}
208206
}
209207

@@ -225,7 +223,7 @@ class DiskCache(
225223
if (clientRegistration.expiresAt.isNotExpired()) {
226224
return clientRegistration
227225
} else {
228-
LOG.warn { "Client Registration is expired" }
226+
LOG.info("Client Registration is expired")
229227
AuthTelemetry.modifyConnection(
230228
action = "Validate Credentials",
231229
source = "loadClientRegistration",
@@ -236,7 +234,7 @@ class DiskCache(
236234
return null
237235
}
238236
} catch (e: Exception) {
239-
LOG.warn { "Client Registration could not be read" }
237+
LOG.info("Client Registration could not be read")
240238
AuthTelemetry.modifyConnection(
241239
action = "Validate Credentials",
242240
source = "loadClientRegistration",
@@ -269,7 +267,7 @@ class DiskCache(
269267
}
270268

271269
private fun writeKey(path: Path, consumer: (OutputStream) -> Unit) {
272-
LOG.debug { "writing to $path" }
270+
LOG.info("writing to $path")
273271
try {
274272
path.tryDirOp(LOG) { createParentDirectories() }
275273

plugins/core/jetbrains-community/src/software/aws/toolkits/jetbrains/core/credentials/sso/SsoAccessTokenProvider.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,7 @@ class SsoAccessTokenProvider(
498498
requestId = requestId,
499499
result = Result.Failed
500500
)
501-
LOG.warn { "RefreshAccessTokenFailed: ${e.message}" }
501+
LOG.info("RefreshAccessTokenFailed: ${e.message}")
502502
throw e
503503
}
504504
}

0 commit comments

Comments
 (0)