diff --git a/backend/src/main/java/ch/puzzle/okr/util/quarter/generate/h2/QuarterFunction.java b/backend/src/main/java/ch/puzzle/okr/util/quarter/generate/h2/QuarterFunction.java index d8c663576c..fec72a232a 100644 --- a/backend/src/main/java/ch/puzzle/okr/util/quarter/generate/h2/QuarterFunction.java +++ b/backend/src/main/java/ch/puzzle/okr/util/quarter/generate/h2/QuarterFunction.java @@ -2,6 +2,8 @@ import ch.puzzle.okr.util.quarter.generate.QuarterData; import ch.puzzle.okr.util.quarter.generate.Quarters; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.context.annotation.Profile; import org.springframework.stereotype.Component; @@ -21,6 +23,7 @@ public class QuarterFunction { public static final int NEXT_QUARTER_DB_ID = 3; private static final Map QUARTERS = new HashMap<>(); + private static final Logger logger = LoggerFactory.getLogger(QuarterFunction.class); public static void initQuarterData() { LocalDate now = LocalDate.now(); @@ -37,27 +40,40 @@ private static void registerCurrentQuarterForDate(LocalDate date, int dbId) { } public static String currentQuarterLabel() { - return QUARTERS.get(CURRENT_QUARTER_DB_ID).label(); + var label = QUARTERS.get(CURRENT_QUARTER_DB_ID).label(); + logger.info("currentQuarterLabel : {}", label); + return label; + } public static String currentQuarterStartDate() { - return QUARTERS.get(CURRENT_QUARTER_DB_ID).startDateAsIsoString(); + var start = QUARTERS.get(CURRENT_QUARTER_DB_ID).startDateAsIsoString(); + logger.info("currentQuarterStartDate: {}", start); + return start; } public static String currentQuarterEndDate() { - return QUARTERS.get(CURRENT_QUARTER_DB_ID).endDateAsIsoString(); + var end = QUARTERS.get(CURRENT_QUARTER_DB_ID).endDateAsIsoString(); + logger.info("currentQuarterEndDate : {}", end); + return end; } public static String nextQuarterLabel() { - return QUARTERS.get(NEXT_QUARTER_DB_ID).label(); + var label = QUARTERS.get(NEXT_QUARTER_DB_ID).label(); + logger.info("nextQuarterLabel : {}", label); + return label; } public static String nextQuarterStartDate() { - return QUARTERS.get(NEXT_QUARTER_DB_ID).startDateAsIsoString(); + var start = QUARTERS.get(NEXT_QUARTER_DB_ID).startDateAsIsoString(); + logger.info("nextQuarterStartDate : {}", start); + return start; } public static String nextQuarterEndDate() { - return QUARTERS.get(NEXT_QUARTER_DB_ID).endDateAsIsoString(); + var end = QUARTERS.get(NEXT_QUARTER_DB_ID).endDateAsIsoString(); + logger.info("nextQuarterEndDate : {}", end); + return end; } }