Skip to content

Commit

Permalink
1726 Reduce log level within loops (#1732)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-kuruvilla authored Jul 15, 2024
2 parents cbd78c2 + 0efe05a commit b423304
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public synchronized void execute() {
List<Word> words = wordDao.readAll();
logger.info("words.size(): " + words.size());
for (Word word : words) {
logger.info("word.getText(): " + word.getText());
logger.debug("word.getText(): " + word.getText());
for (LetterSoundCorrespondence letterSound : word.getLetterSounds()) {
letterSoundCorrespondenceFrequencyMap.put(letterSound.getId(),
letterSoundCorrespondenceFrequencyMap.getOrDefault(letterSound.getId(), 0) + word.getUsageCount());
Expand All @@ -48,10 +48,10 @@ public synchronized void execute() {

// Update the values previously stored in the database
for (LetterSoundCorrespondence letterSoundCorrespondence : letterSoundDao.readAll()) {
logger.info("letterSoundCorrespondence.getId(): " + letterSoundCorrespondence.getId());
logger.info("letterSoundCorrespondence Letters: \"" + letterSoundCorrespondence.getLetters().stream().map(Letter::getText).collect(Collectors.joining()) + "\"");
logger.info("letterSoundCorrespondence Sounds: /" + letterSoundCorrespondence.getSounds().stream().map(Sound::getValueIpa).collect(Collectors.joining()) + "/");
logger.info("letterSoundCorrespondence.getUsageCount() (before update): " + letterSoundCorrespondence.getUsageCount());
logger.debug("letterSoundCorrespondence.getId(): " + letterSoundCorrespondence.getId());
logger.debug("letterSoundCorrespondence Letters: \"" + letterSoundCorrespondence.getLetters().stream().map(Letter::getText).collect(Collectors.joining()) + "\"");
logger.debug("letterSoundCorrespondence Sounds: /" + letterSoundCorrespondence.getSounds().stream().map(Sound::getValueIpa).collect(Collectors.joining()) + "/");
logger.debug("letterSoundCorrespondence.getUsageCount() (before update): " + letterSoundCorrespondence.getUsageCount());

int newUsageCount = 0;
if (letterSoundCorrespondenceFrequencyMap.containsKey(letterSoundCorrespondence.getId())) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public synchronized void execute() {
List<StoryBook> storyBooks = storyBookDao.readAllOrdered();
logger.info("storyBooks.size(): " + storyBooks.size());
for (StoryBook storyBook : storyBooks) {
logger.info("storyBook.getTitle(): " + storyBook.getTitle());
logger.debug("storyBook.getTitle(): " + storyBook.getTitle());

List<String> paragraphs = new ArrayList<>();
List<StoryBookChapter> storyBookChapters = storyBookChapterDao.readAll(storyBook);
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/ai/elimu/tasks/ParagraphWordScheduler.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@ public synchronized void execute() {
// Look for matches of existing Words in the paragraph's original text
List<Word> words = new ArrayList<>();
for (String wordInOriginalText : wordsInOriginalText) {
logger.info("wordInOriginalText: \"" + wordInOriginalText + "\"");
logger.debug("wordInOriginalText: \"" + wordInOriginalText + "\"");
wordInOriginalText = wordInOriginalText.toLowerCase();
logger.info("wordInOriginalText (lower-case): \"" + wordInOriginalText + "\"");
logger.debug("wordInOriginalText (lower-case): \"" + wordInOriginalText + "\"");
Word word = wordDao.readByText(wordInOriginalText);
logger.info("word: " + word);
logger.debug("word: " + word);
words.add(word);
}
logger.info("words.size(): " + words.size());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public synchronized void execute() {
List<StoryBook> storyBooks = storyBookDao.readAllOrdered();
logger.info("storyBooks.size(): " + storyBooks.size());
for (StoryBook storyBook : storyBooks) {
logger.info("storyBook.getTitle(): " + storyBook.getTitle());
logger.debug("storyBook.getTitle(): " + storyBook.getTitle());

List<String> paragraphs = new ArrayList<>();
List<StoryBookChapter> storyBookChapters = storyBookChapterDao.readAll(storyBook);
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/ai/elimu/tasks/WordUsageCountScheduler.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public synchronized void execute() {
List<StoryBook> storyBooks = storyBookDao.readAllOrdered();
logger.info("storyBooks.size(): " + storyBooks.size());
for (StoryBook storyBook : storyBooks) {
logger.info("storyBook.getTitle(): " + storyBook.getTitle());
logger.debug("storyBook.getTitle(): " + storyBook.getTitle());

List<String> paragraphs = new ArrayList<>();
List<StoryBookChapter> storyBookChapters = storyBookChapterDao.readAll(storyBook);
Expand Down

0 comments on commit b423304

Please sign in to comment.