Skip to content

Instantly share code, notes, and snippets.

@WesJD
Created March 12, 2016 02:29
Show Gist options
  • Save WesJD/36e53368e68a37f797a9 to your computer and use it in GitHub Desktop.
Save WesJD/36e53368e68a37f797a9 to your computer and use it in GitHub Desktop.
Easy logging.
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