public static boolean verbose = false;
public static boolean logDates = false;
public static Date lastDate = null;
public static boolean verbose = false;
public static boolean logDates = false;
public static Date lastDate = null;
private static final int PURPLE = 35;
private static final int BROWN = 33;
private static final int GRAY = 37;
private static final int PURPLE = 35;
private static final int BROWN = 33;
private static final int GRAY = 37;
private static String color(int color, boolean bright, String s) {
if (!Log.color) return s;
return
private static String color(int color, boolean bright, String s) {
if (!Log.color) return s;
return
if (firstMessage && !logDates) {
firstMessage = false;
System.err.println(color(GREEN, false, "==========================================================================="));
if (firstMessage && !logDates) {
firstMessage = false;
System.err.println(color(GREEN, false, "==========================================================================="));
- color(PURPLE, true, "r") + " " : "";
- diag(Log.class, "Logging enabled at " + new java.util.Date() + " " + incolor);
+ color(PURPLE, true, "r"));
while (classname.length() < (logDates ? 14 : 20)) classname = " " + classname;
classname = classname + (classname.trim().length() == 0 ? " " : ": ");
classname = color(GRAY, true, classname);
while (classname.length() < (logDates ? 14 : 20)) classname = " " + classname;
classname = classname + (classname.trim().length() == 0 ? " " : ": ");
classname = color(GRAY, true, classname);
} catch (IOException e) {
System.err.println(color(RED, true, "Logger: exception thrown by ByteArrayInputStream -- this should not happen"));
}
} catch (IOException e) {
System.err.println(color(RED, true, "Logger: exception thrown by ByteArrayInputStream -- this should not happen"));
}
while(str.indexOf('\n') != -1) {
System.err.println(classname + color(levelcolor, bright, str.substring(0, str.indexOf('\n'))));
classname = logDates ? " " : " ";
while(str.indexOf('\n') != -1) {
System.err.println(classname + color(levelcolor, bright, str.substring(0, str.indexOf('\n'))));
classname = logDates ? " " : " ";
str = str.substring(str.indexOf('\n') + 1);
}
System.err.println(classname + color(levelcolor, bright, str));
str = str.substring(str.indexOf('\n') + 1);
}
System.err.println(classname + color(levelcolor, bright, str));