Skip to content

Commit

Permalink
style(MavenSupport): Simplify logging of local repositories
Browse files Browse the repository at this point in the history
The comment was no in-line with the code anyway, so address this by
avoiding the outer condition for the log level completely.

Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
  • Loading branch information
sschuberth committed Feb 21, 2023
1 parent 65be79a commit 4879ca5
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions analyzer/src/main/kotlin/managers/utils/MavenSupport.kt
Original file line number Diff line number Diff line change
Expand Up @@ -525,12 +525,8 @@ class MavenSupport(private val workspaceReader: WorkspaceReader) {
RemoteRepository.Builder(repository).setAuthentication(authentication).setProxy(proxy).build()
}

if (logger.delegate.isDebugEnabled) {
val localRepositories = allRepositories - remoteRepositories
if (localRepositories.isNotEmpty()) {
// No need to use curly-braces-syntax for logging here as the log level check is already done above.
logger.debug { "Ignoring local repositories $localRepositories." }
}
if (allRepositories.size > remoteRepositories.size) {
logger.debug { "Ignoring local repositories ${allRepositories - remoteRepositories}." }
}

logger.debug { "Searching for '$artifact' in $remoteRepositories." }
Expand Down

0 comments on commit 4879ca5

Please sign in to comment.