OSDN Git Service

fix: change log text with using format text.
authorhizumiaoba <56146205+hizumiaoba@users.noreply.github.com>
Tue, 7 Dec 2021 12:57:05 +0000 (21:57 +0900)
committerhizumiaoba <56146205+hizumiaoba@users.noreply.github.com>
Tue, 7 Dec 2021 12:57:05 +0000 (21:57 +0900)
src/com/ranfa/lib/AlbumTypeEstimate.java
src/com/ranfa/lib/Scraping.java
src/com/ranfa/main/DelesteRandomSelector.java

index 9acaa04..698f999 100644 (file)
@@ -52,7 +52,7 @@ public class AlbumTypeEstimate {
                } catch (IOException | InterruptedException | ExecutionException e) {
                        e.printStackTrace();
                }
-               logger.info("Album type fetched in " + (System.currentTimeMillis() - time) + "ms");
+               logger.info("Album type fetched in {} ms", (System.currentTimeMillis() - time));
                return res;
        }
 
index 10343a5..e24082d 100644 (file)
@@ -111,7 +111,7 @@ public class Scraping {
                } catch (IOException | InterruptedException | ExecutionException e) {
                        e.printStackTrace();
                }
-               logger.info("scraping compeleted in " + (System.currentTimeMillis() - time)+ "ms");
+               logger.info("scraping compeleted in {} ms", (System.currentTimeMillis() - time));
                return res;
        }
 
@@ -221,7 +221,7 @@ public class Scraping {
                } else {
                        throw new NullPointerException("json is null.");
                }
-               logger.info("JSON reading compeleted in " + (System.currentTimeMillis() - time) + "ms");
+               logger.info("JSON reading compeleted in {} ms", (System.currentTimeMillis() - time));
                return res;
        }
 
index 3516dbf..ec8226b 100644 (file)
@@ -126,12 +126,12 @@ public class DelesteRandomSelector extends JFrame {
                property.setSongLimit(Settings.getSongsLimit());
                property.setSaveScoreLog(Settings.saveScoreLog());
                logger.debug("Load settings done.");
-               logger.debug("Version check: " + property.isCheckVersion());
-               logger.debug("Library update check: " + property.isCheckLibraryUpdates());
-               logger.debug("Window Width: " + property.getWindowWidth());
-               logger.debug("Window Height: " + property.getWindowHeight());
-               logger.debug("Song Limit: " + property.getSongLimit());
-               logger.debug("SaveScoreLog: " + property.isSaveScoreLog());
+               logger.debug("Version check: {}", property.isCheckVersion());
+               logger.debug("Library update check: {}", property.isCheckLibraryUpdates());
+               logger.debug("Window Width: {}", property.getWindowWidth());
+               logger.debug("Window Height: {}", property.getWindowHeight());
+               logger.debug("Song Limit: {}", property.getSongLimit());
+               logger.debug("SaveScoreLog: {}", property.isSaveScoreLog());
                EstimateAlbumTypeCycle.Initialization();
                if(Files.exists(Paths.get("generated/albumCycle.json"))) {
                        albumType = EstimateAlbumTypeCycle.getCurrentCycle();
@@ -143,10 +143,10 @@ public class DelesteRandomSelector extends JFrame {
                        logger.info("Checking database updates...");
                        if(list1.size() > list2.size()) {
                                long time = System.currentTimeMillis();
-                               logger.info((list1.size() - list2.size()) + " Update detected.");
+                               logger.info("{} Update detected.", (list1.size() - list2.size()));
                                Scraping.writeToJson(list1);
-                               logger.info("Update completed in " + (System.currentTimeMillis() - time) + "ms");
-                               logger.info("Updated database size: " + list1.size());
+                               logger.info("Update completed in {} ms", (System.currentTimeMillis() - time));
+                               logger.info("Updated database size: {}", list1.size());
                        } else {
                                logger.info("database is up-to-date.");
                        }
@@ -167,7 +167,7 @@ public class DelesteRandomSelector extends JFrame {
                        CompletableFuture<Void> updatedFuture = getWholeDataFuture.thenAcceptBothAsync(getFromJsonFuture, updateConsumer, es);
                        updatedFuture.thenRunAsync(setEnabled, es);
                }
-               logger.debug("Version:" + CheckVersion.getVersion());
+               logger.debug("Version: {}", CheckVersion.getVersion());
                setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                setBounds(100, 100, property.getWindowWidth(), property.getWindowHeight());
                // setBounds(100, 100, 640, 360);