Skip to content

Commit

Permalink
Add more debug logging
Browse files Browse the repository at this point in the history
  • Loading branch information
timja committed Aug 28, 2024
1 parent 94cd5f6 commit 90d8dde
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ public long getRetryInterval() {

public static String getChannelId(String botUserToken, String channelName) throws ExecutionException, InterruptedException, AbortException {
if (channelName.matches("^(C[A-Z0-9]{8}|G[A-Z0-9]{10}||D[A-Z0-9]{8})$")) {
logger.info("Channel name is already an ID: " + channelName);

Check warning on line 77 in src/main/java/jenkins/plugins/slack/cache/SlackChannelIdCache.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Not covered line

Line 77 is not covered by tests
return channelName;
}
Map<String, String> channelNameToIdMap = CHANNEL_METADATA_CACHE.get(botUserToken);
Expand All @@ -90,8 +91,13 @@ public static String getChannelId(String botUserToken, String channelName) throw
}

channelId = channelNameToIdMap.get(channelName);
logger.info(String.format("After reloading cache for %s found channel ID: %s", channelName, channelId));
} else {
logger.info(String.format("Found channel %s ID in cache: %s", channelName, channelId));

Check warning on line 96 in src/main/java/jenkins/plugins/slack/cache/SlackChannelIdCache.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Not covered line

Line 96 is not covered by tests
}

logger.info(String.format("Result for %s is %s", channelName, channelId));

return channelId;
}

Expand Down

0 comments on commit 90d8dde

Please sign in to comment.