Replace concatenation with parameterized log message

This commit is contained in:
FlorianMichael 2024-09-06 21:24:35 +02:00
parent eea48d6c74
commit 83d6348f0d
No known key found for this signature in database
GPG Key ID: C2FB87E71C425126

View File

@ -55,7 +55,7 @@ public abstract class AbstractSave {
try (final FileReader fr = new FileReader(file)) {
read(GSON.fromJson(fr, JsonObject.class));
} catch (Exception e) {
ViaFabricPlus.global().getLogger().error("Failed to read file: " + file.getName() + "!", e);
ViaFabricPlus.global().getLogger().error("Failed to read file: {}!", file.getName(), e);
}
}
}
@ -68,7 +68,7 @@ public abstract class AbstractSave {
file.delete();
file.createNewFile();
} catch (IOException e) {
ViaFabricPlus.global().getLogger().error("Failed to create file: " + file.getName() + "!", e);
ViaFabricPlus.global().getLogger().error("Failed to create file: {}!", file.getName(), e);
}
try (final FileWriter fw = new FileWriter(file)) {
@ -77,7 +77,7 @@ public abstract class AbstractSave {
fw.write(GSON.toJson(parentNode));
fw.flush();
} catch (IOException e) {
ViaFabricPlus.global().getLogger().error("Failed to write file: " + file.getName() + "!", e);
ViaFabricPlus.global().getLogger().error("Failed to write file: {}!", file.getName(), e);
}
}