Skip to content

Commit 3a1b2ba

Browse files
committed
make dependency loader log a bit less console-spammy
1 parent 6bc48bb commit 3a1b2ba

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

src/main/java/com/falsepattern/lib/dependencies/DependencyLoader.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ public static void loadLibrary(@NonNull String loadingModId,
117117
try {
118118
addToClasspath(file);
119119
loadedLibraries.put(artifact, preferredVersion);
120-
log.info("Library {} successfully loaded from disk!", artifactLogName);
120+
log.debug("Library {} successfully loaded from disk!", artifactLogName);
121121
return;
122122
} catch (RuntimeException e) {
123123
log.warn("Failed to load library {} from file! Re-downloading...", artifactLogName);
@@ -151,29 +151,29 @@ public static void loadLibrary(@NonNull String loadingModId,
151151
}
152152
val success = new AtomicBoolean(false);
153153
Internet.connect(new URL(url),
154-
(ex) -> log.info("Artifact {} could not be downloaded from repo {}: {}", artifactLogName,
154+
(ex) -> log.debug("Artifact {} could not be downloaded from repo {}: {}", artifactLogName,
155155
finalRepo, ex.getMessage()),
156156
(input) -> {
157-
log.info("Downloading {} from {}", artifactLogName, finalRepo);
157+
log.debug("Downloading {} from {}", artifactLogName, finalRepo);
158158
download(input, file);
159-
log.info("Downloaded {}", artifactLogName);
159+
log.debug("Downloaded {} from {}", artifactLogName, finalRepo);
160160
success.set(true);
161161
});
162162
if (success.get()) {
163-
log.info("Validating checksum for {}", artifactLogName);
163+
log.debug("Validating checksum for {}", artifactLogName);
164164
boolean hadChecksum = false;
165165
for (val checksumType : CHECKSUM_TYPES) {
166166
val checksumURL = url + "." + checksumType;
167167
val checksumFile = new File(libDir, jarName + "." + checksumType);
168-
log.info("Attempting to get {} checksum...", checksumType);
168+
log.debug("Attempting to get {} checksum...", checksumType);
169169
success.set(false);
170170
Internet.connect(new URL(checksumURL),
171-
(ex) -> log.info("Could not get {} checksum for {}: {}", checksumType,
171+
(ex) -> log.debug("Could not get {} checksum for {}: {}", checksumType,
172172
artifactLogName, ex.getMessage()),
173173
(input) -> {
174-
log.info("Downloading {} checksum for {}", checksumType, artifactLogName);
174+
log.debug("Downloading {} checksum for {}", checksumType, artifactLogName);
175175
download(input, checksumFile);
176-
log.info("Downloaded {} checksum for {}", checksumType, artifactLogName);
176+
log.debug("Downloaded {} checksum for {}", checksumType, artifactLogName);
177177
success.set(true);
178178
});
179179
if (success.get()) {
@@ -187,7 +187,7 @@ public static void loadLibrary(@NonNull String loadingModId,
187187
retry = true;
188188
continue redownload;
189189
}
190-
log.info("Successfully validated {} checksum for {}", checksumType,
190+
log.debug("Successfully validated {} checksum for {}", checksumType,
191191
artifactLogName);
192192
hadChecksum = true;
193193
break;
@@ -261,7 +261,7 @@ private static void addToClasspath(File file) {
261261
try {
262262
val cl = (LaunchClassLoader) DependencyLoader.class.getClassLoader();
263263
cl.addURL(file.toURI().toURL());
264-
log.info("Injected file {} into classpath!", file.getPath());
264+
log.debug("Injected file {} into classpath!", file.getPath());
265265
} catch (Exception e) {
266266
throw new RuntimeException("Failed to add library to classpath: " + file.getAbsolutePath(), e);
267267
}

0 commit comments

Comments
 (0)