-
Notifications
You must be signed in to change notification settings - Fork 161
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Previously, we used the Forge Modloader logger, so messages would appear as [FML]: [TerrainControl] (message). Now we use our own logger, so that [TerrainControl] now replaces [FML]. However, this means that messages would appear as[TerrainControl]: [TerrainControl] (message). The second [TerrainControl] was added by our own logger class, as Bukkit (unlike Forge) doesn't prefix each message with the mod name. Now Bukkit and Forge have their own Logger implementation, and only the Bukkit implementation adds [TerrainControl].
- Loading branch information
Showing
12 changed files
with
189 additions
and
303 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 0 additions & 39 deletions
39
common/src/main/java/com/khorn/terraincontrol/logging/LogFactory.java
This file was deleted.
Oops, something went wrong.
58 changes: 10 additions & 48 deletions
58
common/src/main/java/com/khorn/terraincontrol/logging/LogMarker.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,55 +1,17 @@ | ||
package com.khorn.terraincontrol.logging; | ||
|
||
import org.apache.logging.log4j.Level; | ||
import org.apache.logging.log4j.Marker; | ||
import org.apache.logging.log4j.MarkerManager; | ||
|
||
import java.util.LinkedHashMap; | ||
import java.util.Map; | ||
|
||
/** | ||
* Holds the log markers and allows to compare them to each other. | ||
* | ||
* <p>Markers for specific Log levels, we use these as internal Log Levels, but can | ||
* be used to filter logs in a very specific way.</p> | ||
*/ | ||
public class LogMarker | ||
public enum LogMarker | ||
{ | ||
|
||
/* | ||
* Markers for specific Log levels, we use these as internal Log Levels, but | ||
* can be used to filter logs in a very specific way | ||
*/ | ||
public static final Marker FATAL = MarkerManager.getMarker("com.khorn.terraincontrol.FATAL"); | ||
public static final Marker ERROR = MarkerManager.getMarker("com.khorn.terraincontrol.ERROR", LogMarker.FATAL); | ||
public static final Marker WARN = MarkerManager.getMarker("com.khorn.terraincontrol.WARN", LogMarker.ERROR); | ||
public static final Marker INFO = MarkerManager.getMarker("com.khorn.terraincontrol.INFO", LogMarker.WARN); | ||
public static final Marker DEBUG = MarkerManager.getMarker("com.khorn.terraincontrol.DEBUG", LogMarker.INFO); | ||
public static final Marker TRACE = MarkerManager.getMarker("com.khorn.terraincontrol.TRACE", LogMarker.DEBUG); | ||
|
||
private static Map<Marker, Integer> standardLevels = new LinkedHashMap<Marker, Integer>(6); | ||
|
||
private LogMarker() | ||
{ | ||
} | ||
|
||
static | ||
{ | ||
standardLevels.put(FATAL, Level.FATAL.intLevel()); | ||
standardLevels.put(ERROR, Level.ERROR.intLevel()); | ||
standardLevels.put(WARN, Level.WARN.intLevel()); | ||
standardLevels.put(INFO, Level.INFO.intLevel()); | ||
standardLevels.put(DEBUG, Level.DEBUG.intLevel()); | ||
standardLevels.put(TRACE, Level.TRACE.intLevel()); | ||
} | ||
|
||
public static int compare(Marker first, Marker second) | ||
{ | ||
Integer firstInt = standardLevels.get(first); | ||
if (firstInt != null) | ||
{ | ||
return standardLevels.get(first).compareTo(standardLevels.get(second)); | ||
} else | ||
{ | ||
return 0; | ||
} | ||
} | ||
|
||
FATAL, | ||
ERROR, | ||
WARN, | ||
INFO, | ||
DEBUG, | ||
TRACE | ||
} |
81 changes: 0 additions & 81 deletions
81
common/src/main/java/com/khorn/terraincontrol/logging/Loggable.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.