Skip to content
This repository was archived by the owner on Feb 19, 2019. It is now read-only.

Commit 00b6e2c

Browse files
committed
Clean up Logger usage
1 parent a61f5db commit 00b6e2c

File tree

3 files changed

+11
-14
lines changed

3 files changed

+11
-14
lines changed

src/example/java/me/zero/example/mod/ExampleModManager.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
import me.zero.example.mod.mods.Fly;
2424
import me.zero.example.mod.mods.Hud;
2525
import me.zero.example.mod.mods.Speed;
26-
import org.apache.logging.log4j.Level;
2726

2827
/**
2928
* @author Brady
@@ -37,7 +36,7 @@ public ExampleModManager() {
3736

3837
@Override
3938
public final void load() {
40-
ClientAPI.LOGGER.log(Level.INFO, "Loading Modules");
39+
ClientAPI.LOGGER.info("Loading Modules");
4140

4241
// Load Modules
4342
this.addAll(

src/main/java/clientapi/load/ClientTweaker.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
import io.github.impactdevelopment.simpletweaker.transform.SimpleTransformer;
2525
import net.minecraft.launchwrapper.Launch;
2626
import net.minecraft.launchwrapper.LaunchClassLoader;
27-
import org.apache.logging.log4j.Level;
2827
import org.spongepowered.asm.launch.MixinBootstrap;
2928
import org.spongepowered.asm.mixin.MixinEnvironment;
3029
import org.spongepowered.asm.mixin.Mixins;
@@ -45,7 +44,7 @@ public final class ClientTweaker extends SimpleTweaker {
4544
public void injectIntoClassLoader(LaunchClassLoader classLoader) {
4645
super.injectIntoClassLoader(classLoader);
4746

48-
ClientAPI.LOGGER.log(Level.INFO, "Injecting into ClassLoader");
47+
ClientAPI.LOGGER.info("Injecting into ClassLoader");
4948

5049
this.setupMixin();
5150

@@ -60,7 +59,7 @@ public void injectIntoClassLoader(LaunchClassLoader classLoader) {
6059
for (String mixin : config.getMixins())
6160
loadMixinConfig(mixin);
6261

63-
ClientAPI.LOGGER.log(Level.INFO, "Loaded Mixin Configurations");
62+
ClientAPI.LOGGER.info("Loaded Mixin Configurations");
6463
}
6564

6665
@Override
@@ -71,7 +70,7 @@ public final String getLaunchTarget() {
7170
@SuppressWarnings("unchecked")
7271
private void setupMixin() {
7372
MixinBootstrap.init();
74-
ClientAPI.LOGGER.log(Level.INFO, "Initialized Mixin bootstrap");
73+
ClientAPI.LOGGER.info("Initialized Mixin bootstrap");
7574

7675
// Find all of the other tweakers that are being loaded
7776
List<String> tweakClasses = (List<String>) Launch.blackboard.get("TweakClasses");
@@ -82,12 +81,12 @@ private void setupMixin() {
8281
// If there are any tweak classes that contain "FMLTweaker", then set the obfuscation context to SEARGE
8382
if (tweakClasses.stream().anyMatch(s -> s.contains("FMLTweaker"))) {
8483
obfuscation = ObfuscationServiceMCP.SEARGE;
85-
ClientAPI.LOGGER.log(Level.INFO, "Discovered FML! Switching to SEARGE mappings.");
84+
ClientAPI.LOGGER.info("Discovered FML! Switching to SEARGE mappings.");
8685
}
8786

8887
MixinEnvironment.getDefaultEnvironment().setSide(MixinEnvironment.Side.CLIENT);
8988
MixinEnvironment.getDefaultEnvironment().setObfuscationContext(obfuscation);
90-
ClientAPI.LOGGER.log(Level.INFO, "Setup Mixin Environment");
89+
ClientAPI.LOGGER.info("Setup Mixin Environment");
9190
}
9291

9392
private void setupTransformers(ClientConfiguration config) {
@@ -98,7 +97,7 @@ private void setupTransformers(ClientConfiguration config) {
9897

9998
transformer.registerAll(config.getTransformers());
10099

101-
ClientAPI.LOGGER.log(Level.INFO, "Registered Bytecode Transformes");
100+
ClientAPI.LOGGER.info("Registered Bytecode Transformes");
102101
}
103102

104103
private ClientConfiguration findClientConfig() {

src/main/java/clientapi/util/io/FileManager.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
package clientapi.util.io;
1818

1919
import clientapi.ClientAPI;
20-
import org.apache.logging.log4j.Level;
2120

2221
import java.io.*;
2322
import java.nio.file.Files;
@@ -56,7 +55,7 @@ public static FileContents read(String file) {
5655
bufferedReader.lines().forEach(data::add);
5756
bufferedReader.close();
5857
} catch (IOException ex) {
59-
ClientAPI.LOGGER.log(Level.WARN, "Unable to read from " + file);
58+
ClientAPI.LOGGER.warn("Unable to read from " + file);
6059
}
6160

6261
return new FileContents(data);
@@ -84,7 +83,7 @@ public static void write(List<String> data, String file) {
8483
}
8584
bw.close();
8685
} catch (IOException e) {
87-
ClientAPI.LOGGER.log(Level.WARN, "Unable to write to " + file);
86+
ClientAPI.LOGGER.warn("Unable to write to " + file);
8887
}
8988
}
9089

@@ -97,14 +96,14 @@ public static void createFile(String file) {
9796
try {
9897
Files.createDirectories(Paths.get(new File(file).getParent()));
9998
} catch (IOException e) {
100-
ClientAPI.LOGGER.log(Level.WARN, "Unable to create parent directories", e);
99+
ClientAPI.LOGGER.warn("Unable to create parent directories", e);
101100
return;
102101
}
103102

104103
try {
105104
Files.createFile(Paths.get(file));
106105
} catch (IOException e) {
107-
ClientAPI.LOGGER.log(Level.WARN, "Unable to create file", e);
106+
ClientAPI.LOGGER.warn("Unable to create file", e);
108107
}
109108
}
110109

0 commit comments

Comments
 (0)