com.github.mathiewz.slick.util.Log Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of modernized-slick Show documentation
Show all versions of modernized-slick Show documentation
The main purpose of this libraryis to modernize and maintain the slick2D library.
The newest version!
package com.github.mathiewz.slick.util;
import java.security.AccessController;
import java.security.PrivilegedAction;
/**
* A simple central logging system
*
* @author kevin
*/
public final class Log {
/** True if we're doing verbose logging INFO and DEBUG */
private static boolean verbose = true;
/** true if activated by the system property "com.github.mathiewz.slick.forceVerboseLog" */
private static boolean forcedVerbose = false;
/**
* The debug property which can be set via JNLP or startup parameter to switch
* logging mode to verbose for games that were released without verbose logging
* value must be "true"
*/
private static final String FORCE_VERBOSE_PROPERTY = "com.github.mathiewz.slick.forceVerboseLog";
/**
* the verbose property must be set to "true" to switch on verbose logging
*/
private static final String FORCE_VERBOSE_PROPERTY_ON_VALUE = "true";
/** The log system plugin in use */
private static LogSystem logSystem = new DefaultLogSystem();
private Log() {
// to avoid instantiation
}
/**
* Indicate that we want verbose logging.
* The call is ignored if verbose logging is forced by the system property
* "com.github.mathiewz.slick.forceVerboseLog"
*
* @param v
* True if we want verbose logging (INFO and DEBUG)
*/
public static void setVerbose(boolean v) {
if (forcedVerbose) {
return;
}
verbose = v;
}
/**
* Check if the system property com.github.mathiewz.slick.verboseLog is set to true.
* If this is the case we activate the verbose logging mode
*/
public static void checkVerboseLogSetting() {
try {
PrivilegedAction
© 2015 - 2025 Weber Informatics LLC | Privacy Policy