@@ -22,17 +22,16 @@ import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule
22
22
import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper
23
23
import com.fasterxml.jackson.module.kotlin.readValue
24
24
import software.aws.toolkits.core.utils.createParentDirectories
25
- import software.aws.toolkits.core.utils.debug
26
25
import software.aws.toolkits.core.utils.deleteIfExists
27
26
import software.aws.toolkits.core.utils.getLogger
27
+ import software.aws.toolkits.core.utils.info
28
28
import software.aws.toolkits.core.utils.inputStreamIfExists
29
29
import software.aws.toolkits.core.utils.outputStream
30
30
import software.aws.toolkits.core.utils.toHexString
31
31
import software.aws.toolkits.core.utils.touch
32
32
import software.aws.toolkits.core.utils.tryDirOp
33
33
import software.aws.toolkits.core.utils.tryFileOp
34
34
import software.aws.toolkits.core.utils.tryOrNull
35
- import software.aws.toolkits.core.utils.warn
36
35
import software.aws.toolkits.telemetry.AuthTelemetry
37
36
import software.aws.toolkits.telemetry.Result
38
37
import java.io.InputStream
@@ -97,16 +96,16 @@ class DiskCache(
97
96
}
98
97
99
98
override fun invalidateClientRegistration (ssoRegion : String ) {
100
- LOG .debug { " invalidateClientRegistration for $ssoRegion " }
99
+ LOG .info { " invalidateClientRegistration for $ssoRegion " }
101
100
clientRegistrationCache(ssoRegion).tryDeleteIfExists()
102
101
}
103
102
104
103
override fun loadClientRegistration (cacheKey : ClientRegistrationCacheKey ): ClientRegistration ? {
105
- LOG .debug { " loadClientRegistration for $cacheKey " }
104
+ LOG .info { " loadClientRegistration for $cacheKey " }
106
105
val inputStream = clientRegistrationCache(cacheKey).tryInputStreamIfExists()
107
106
if (inputStream == null ) {
108
107
val stage = LoadCredentialStage .ACCESS_FILE
109
- LOG .warn { " Failed to load Client Registration: cache file does not exist" }
108
+ LOG .info { " Failed to load Client Registration: cache file does not exist" }
110
109
AuthTelemetry .modifyConnection(
111
110
action = " Load cache file" ,
112
111
source = " loadClientRegistration" ,
@@ -120,15 +119,15 @@ class DiskCache(
120
119
}
121
120
122
121
override fun saveClientRegistration (cacheKey : ClientRegistrationCacheKey , registration : ClientRegistration ) {
123
- LOG .debug { " saveClientRegistration for $cacheKey " }
122
+ LOG .info { " saveClientRegistration for $cacheKey " }
124
123
val registrationCache = clientRegistrationCache(cacheKey)
125
124
writeKey(registrationCache) {
126
125
objectMapper.writeValue(it, registration)
127
126
}
128
127
}
129
128
130
129
override fun invalidateClientRegistration (cacheKey : ClientRegistrationCacheKey ) {
131
- LOG .debug { " invalidateClientRegistration for $cacheKey " }
130
+ LOG .info { " invalidateClientRegistration for $cacheKey " }
132
131
try {
133
132
clientRegistrationCache(cacheKey).tryDeleteIfExists()
134
133
} catch (e: Exception ) {
@@ -144,7 +143,7 @@ class DiskCache(
144
143
}
145
144
146
145
override fun invalidateAccessToken (ssoUrl : String ) {
147
- LOG .debug { " invalidateAccessToken for $ssoUrl " }
146
+ LOG .info { " invalidateAccessToken for $ssoUrl " }
148
147
try {
149
148
accessTokenCache(ssoUrl).tryDeleteIfExists()
150
149
} catch (e: Exception ) {
@@ -160,7 +159,7 @@ class DiskCache(
160
159
}
161
160
162
161
override fun loadAccessToken (cacheKey : AccessTokenCacheKey ): AccessToken ? {
163
- LOG .debug { " loadAccessToken for $cacheKey " }
162
+ LOG .info { " loadAccessToken for $cacheKey " }
164
163
val cacheFile = accessTokenCache(cacheKey)
165
164
val inputStream = cacheFile.tryInputStreamIfExists() ? : return null
166
165
@@ -170,15 +169,15 @@ class DiskCache(
170
169
}
171
170
172
171
override fun saveAccessToken (cacheKey : AccessTokenCacheKey , accessToken : AccessToken ) {
173
- LOG .debug { " saveAccessToken for $cacheKey " }
172
+ LOG .info { " saveAccessToken for $cacheKey " }
174
173
val accessTokenCache = accessTokenCache(cacheKey)
175
174
writeKey(accessTokenCache) {
176
175
objectMapper.writeValue(it, accessToken)
177
176
}
178
177
}
179
178
180
179
override fun invalidateAccessToken (cacheKey : AccessTokenCacheKey ) {
181
- LOG .debug { " invalidateAccessToken for $cacheKey " }
180
+ LOG .info { " invalidateAccessToken for $cacheKey " }
182
181
try {
183
182
accessTokenCache(cacheKey).tryDeleteIfExists()
184
183
} catch (e: Exception ) {
@@ -203,7 +202,7 @@ class DiskCache(
203
202
val sha = sha1(cacheNameMapper.writeValueAsString(it))
204
203
205
204
cacheDir.resolve(" $sha .json" ).also {
206
- LOG .debug { " $cacheKey resolves to $it " }
205
+ LOG .info { " $cacheKey resolves to $it " }
207
206
}
208
207
}
209
208
@@ -225,7 +224,7 @@ class DiskCache(
225
224
if (clientRegistration.expiresAt.isNotExpired()) {
226
225
return clientRegistration
227
226
} else {
228
- LOG .warn { " Client Registration is expired" }
227
+ LOG .info { " Client Registration is expired" }
229
228
AuthTelemetry .modifyConnection(
230
229
action = " Validate Credentials" ,
231
230
source = " loadClientRegistration" ,
@@ -236,7 +235,7 @@ class DiskCache(
236
235
return null
237
236
}
238
237
} catch (e: Exception ) {
239
- LOG .warn { " Client Registration could not be read" }
238
+ LOG .info { " Client Registration could not be read" }
240
239
AuthTelemetry .modifyConnection(
241
240
action = " Validate Credentials" ,
242
241
source = " loadClientRegistration" ,
@@ -269,7 +268,7 @@ class DiskCache(
269
268
}
270
269
271
270
private fun writeKey (path : Path , consumer : (OutputStream ) -> Unit ) {
272
- LOG .debug { " writing to $path " }
271
+ LOG .info { " writing to $path " }
273
272
try {
274
273
path.tryDirOp(LOG ) { createParentDirectories() }
275
274
0 commit comments