Permalink
Browse files

Now using com.dumptruckman.minecraft:Logging for logging purposes.

  • Loading branch information...
1 parent efc97c7 commit a033990cf4cc5cb7abc53d5a91ae13d440a6846c @dumptruckman dumptruckman committed Oct 20, 2012
Showing with 60 additions and 13 deletions.
  1. +41 −0 pom.xml
  2. +19 −13 src/main/java/com/onarandombox/MultiversePortals/MultiversePortals.java
View
41 pom.xml
@@ -112,6 +112,37 @@
</execution>
</executions>
</plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-shade-plugin</artifactId>
+ <version>1.5</version>
+ <executions>
+ <execution>
+ <phase>package</phase>
+ <goals>
+ <goal>shade</goal>
+ </goals>
+ <configuration>
+ <artifactSet>
+ <includes>
+ <include>com.dumptruckman.minecraft:Logging</include>
+ </includes>
+ </artifactSet>
+ <relocations>
+ <relocation>
+ <pattern>com.dumptruckman.minecraft.util.Logging</pattern>
+ <shadedPattern>com.onarandombox.MultiversePortals.util.MVPLogging
+ </shadedPattern>
+ </relocation>
+ <relocation>
+ <pattern>com.dumptruckman.minecraft.util.DebugLog</pattern>
+ <shadedPattern>com.onarandombox.MultiverseCore.utils.DebugFileLogger</shadedPattern>
+ </relocation>
+ </relocations>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
</plugins>
</build>
<dependencies>
@@ -142,6 +173,16 @@
</dependency>
<!-- End of WorldEdit Dependency -->
+ <!-- Start of Logging Dependency -->
+ <dependency>
+ <groupId>com.dumptruckman.minecraft</groupId>
+ <artifactId>Logging</artifactId>
+ <version>1.0.6</version>
+ <type>jar</type>
+ <scope>compile</scope>
+ </dependency>
+ <!-- End of Logging Dependency -->
+
</dependencies>
<distributionManagement>
<repository>
@@ -18,6 +18,7 @@
import java.util.logging.Level;
import java.util.logging.Logger;
+import com.dumptruckman.minecraft.util.Logging;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.configuration.Configuration;
@@ -379,14 +380,27 @@ public void reloadConfigs() {
this.loadConfig();
}
+ /**
+ * Logs a message to Multiverse-Portals's Logger. If the Message is of fine-finest level, it will be logged to the
+ * debug log if enabled.
+ * @param level
+ * @param msg
+ * @deprecated
+ */
+ @Deprecated
public static void staticLog(Level level, String msg) {
- log.log(level, logPrefix + " " + msg);
- debugLog.log(level, logPrefix + " " + msg);
+ Logging.log(level, msg);
}
+ /**
+ *
+ * @param level
+ * @param msg
+ * @deprecated
+ */
+ @Deprecated
public static void staticDebugLog(Level level, String msg) {
- log.log(level, "[MVPortals-Debug] " + msg);
- debugLog.log(level, "[MVPortals-Debug] " + msg);
+ Logging.log(level, msg);
}
public void setWorldEditAPI(WorldEditAPI api) {
@@ -395,15 +409,7 @@ public void setWorldEditAPI(WorldEditAPI api) {
@Override
public void log(Level level, String msg) {
- if (level == Level.FINE && MultiverseCore.getStaticConfig().getGlobalDebug() >= 1) {
- staticDebugLog(Level.INFO, msg);
- } else if (level == Level.FINER && MultiverseCore.getStaticConfig().getGlobalDebug() >= 2) {
- staticDebugLog(Level.INFO, msg);
- } else if (level == Level.FINEST && MultiverseCore.getStaticConfig().getGlobalDebug() >= 3) {
- staticDebugLog(Level.INFO, msg);
- } else if (level != Level.FINE && level != Level.FINER && level != Level.FINEST) {
- staticLog(level, msg);
- }
+ Logging.log(level, msg);
}
@Override

0 comments on commit a033990

Please sign in to comment.