Reduced Sys.debug from bool -> int

This commit is contained in:
Elias Naur 2003-12-20 22:07:19 +00:00
parent 97cb16eb74
commit 615bdfb113
1 changed files with 5 additions and 12 deletions

View File

@ -82,14 +82,14 @@ public final class Sys {
/** /**
* Debug flag. * Debug flag.
*/ */
public static final boolean debug; public static final boolean DEBUG;
static { static {
String debug_level_prop = System.getProperty("org.lwjgl.Sys.debug", "false"); String debug_level_prop = System.getProperty("org.lwjgl.Sys.debug", "false");
if (debug_level_prop.equals("true")) if (debug_level_prop.equals("true"))
debug = true; DEBUG = true;
else else
debug = false; DEBUG = false;
initialize(); initialize();
} }
@ -111,23 +111,16 @@ public final class Sys {
* is true. * is true.
*/ */
public static void log(String msg) { public static void log(String msg) {
if (isDebugEnabled()) if (Sys.DEBUG)
System.err.println(msg); System.err.println(msg);
} }
/**
* @return true if debugging has been enabled
*/
public static boolean isDebugEnabled() {
return debug;
}
/** /**
* Initialization. * Initialization.
*/ */
private static void initialize() { private static void initialize() {
System.loadLibrary(LIBRARY_NAME); System.loadLibrary(LIBRARY_NAME);
setDebug(debug); setDebug(DEBUG);
setTime(0); setTime(0);
Runtime.getRuntime().addShutdownHook(new Thread() { Runtime.getRuntime().addShutdownHook(new Thread() {