Created
March 12, 2016 02:29
-
-
Save WesJD/36e53368e68a37f797a9 to your computer and use it in GitHub Desktop.
Easy logging.
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
public class Logging { | |
private static final String PREFIX = "MyPrefix"; | |
public static void logStatistic(String message) { | |
logWithExtra("Statistic", message); | |
} | |
public static void logDebug(String message) { | |
logWithExtra("Debug", message); | |
} | |
public static void logError(String message) { | |
logWithExtra("Error", message); | |
} | |
public static void logWarning(String message) { | |
logWithExtra("Warning", message); | |
} | |
public static void logInfo(String message) { | |
logWithExtra("Info", message); | |
} | |
public static void logWithExtra(String extra, String message) { | |
System.out.println(PREFIX + ": " + extra + " | " + message); | |
} | |
public static void log(String message) { | |
System.out.println(PREFIX + " | " + message); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment