Skip to content

Commit

Permalink
Bruk logger.info i stedet for println
Browse files Browse the repository at this point in the history
  • Loading branch information
eivinhb committed Aug 16, 2024
1 parent b7c7ed1 commit 537eb0f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/main/kotlin/no/digipost/github/monitoring/Main.kt
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,10 @@ fun cachedGithubApiClientFactory(token: String): () -> GithubApiClient {

return {
if (System.currentTimeMillis() - age.get() < 1000 * 60 * 60 * 10) {
println("Cachet GithubApiClient")
logger.info("Cachet GithubApiClient")
client
} else {
println("Lager ny GithubApiClient")
logger.info("Lager ny GithubApiClient")
client = fakt(token)
age.set(System.currentTimeMillis())
client
Expand All @@ -132,10 +132,10 @@ fun cachedApolloClientFactory(token: String): () -> ApolloClient {

return {
if (System.currentTimeMillis() - age.get() < 1000 * 60 * 60 * 10) {
println("Cachet ApolloClient")
logger.info("Cachet ApolloClient")
client
} else {
println("Lager ny ApolloClient")
logger.info("Lager ny ApolloClient")
client = fakt(token)
age.set(System.currentTimeMillis())
client
Expand All @@ -153,7 +153,7 @@ suspend fun publish(apolloClient: ApolloClient, githubApiClient: GithubApiClient
repos.getUniqueCVEs()
.filter { (cve, vulnerability) -> !existingVulnerabilities!!.containsKey(cve) && VULNERABILITY_ORDERING.indexOf(vulnerability.severity) <= VULNERABILITY_ORDERING.indexOf(severityLimit) }
.forEach { (_, vulnerability) ->
println("Ny sårbarhet: $vulnerability")
logger.info("Ny sårbarhet: $vulnerability")
slackClient?.sendToSlack(vulnerability)
}
}
Expand Down

0 comments on commit 537eb0f

Please sign in to comment.