1
0
mirror of https://github.com/Suiranoil/SkinRestorer.git synced 2026-01-16 04:42:12 +00:00

capitalize logger messages

This commit is contained in:
2024-11-27 13:02:18 +03:00
parent eeda2f5857
commit 4a43a0de41
4 changed files with 10 additions and 10 deletions

View File

@@ -72,17 +72,17 @@ public abstract class ServerLoginPacketListenerImplMixin {
@Unique
private static void skinrestorer$fetchSkin(GameProfile profile, SkinProviderContext context) {
SkinRestorer.LOGGER.debug("fetching {}'s skin", profile.getName());
SkinRestorer.LOGGER.debug("Fetching {}'s skin", profile.getName());
var result = SkinRestorer.getProvider(context.name()).map(
provider -> provider.fetchSkin(context.argument(), context.variant())
).orElseGet(() -> Result.error(new IllegalArgumentException("skin provider is not registered: " + context.name())));
).orElseGet(() -> Result.error(new IllegalArgumentException("Skin provider is not registered: " + context.name())));
if (!result.isError()) {
var value = SkinValue.fromProviderContextWithValue(context, result.getSuccessValue().orElse(null));
SkinRestorer.getSkinStorage().setSkin(profile.getId(), value);
} else {
SkinRestorer.LOGGER.warn("failed to fetch skin", result.getErrorValue());
SkinRestorer.LOGGER.warn("Failed to fetch skin: {}", result.getErrorValue().getMessage());
}
}
}

View File

@@ -42,7 +42,7 @@ public final class FileUtils {
}
}
} catch (Exception e) {
SkinRestorer.LOGGER.error("could not migrate skin directory", e);
SkinRestorer.LOGGER.error("Could not migrate skin directory", e);
}
}
@@ -55,7 +55,7 @@ public final class FileUtils {
return StringUtils.readString(reader);
}
} catch (IOException e) {
SkinRestorer.LOGGER.error("failed to read resource", e);
SkinRestorer.LOGGER.error("Failed to read resource", e);
return null;
}
}
@@ -67,7 +67,7 @@ public final class FileUtils {
return Files.readString(file);
} catch (Exception e) {
SkinRestorer.LOGGER.error("failed to read file", e);
SkinRestorer.LOGGER.error("Failed to read file", e);
return null;
}
}
@@ -83,7 +83,7 @@ public final class FileUtils {
Files.writeString(file, content);
} catch (IOException e) {
SkinRestorer.LOGGER.error("failed to write file", e);
SkinRestorer.LOGGER.error("Failed to write file", e);
}
}
@@ -92,7 +92,7 @@ public final class FileUtils {
if (Files.exists(file))
Files.delete(file);
} catch (IOException e) {
SkinRestorer.LOGGER.error("failed to delete file", e);
SkinRestorer.LOGGER.error("Failed to delete file", e);
}
}
}

View File

@@ -54,7 +54,7 @@ public final class JsonUtils {
return json;
} catch (Exception e) {
SkinRestorer.LOGGER.error(e.toString());
SkinRestorer.LOGGER.error("Could not parse skin property", e);
return null;
}
}

View File

@@ -36,7 +36,7 @@ public final class WebUtils {
try {
builder.connectTimeout(Duration.of(SkinRestorer.getConfig().requestTimeout(), ChronoUnit.SECONDS));
} catch (IllegalArgumentException e) {
SkinRestorer.LOGGER.error("failed to set request timeout", e);
SkinRestorer.LOGGER.error("Failed to set request timeout", e);
builder.connectTimeout(Duration.of(10, ChronoUnit.SECONDS));
}