|
@ -13,17 +13,23 @@ public class TestLogger { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// options
|
|
|
// options
|
|
|
private static boolean logEnabled = true; |
|
|
private static boolean logEnabled; |
|
|
private static int lineWidth; |
|
|
private static int lineWidth; |
|
|
|
|
|
|
|
|
// constants
|
|
|
// constants
|
|
|
private static int threadStrLen = 10; |
|
|
private static int threadStrLen; |
|
|
private static String threadSeparator = ": "; |
|
|
private static String threadSeparator; |
|
|
private static boolean initialized = false; |
|
|
private static boolean initialized; |
|
|
|
|
|
|
|
|
private static void init() { |
|
|
private static void init() { |
|
|
if (!initialized) { |
|
|
if (!initialized) { |
|
|
|
|
|
logEnabled = true; |
|
|
|
|
|
threadStrLen = 10; |
|
|
|
|
|
lineWidth = 80; |
|
|
|
|
|
threadSeparator = ": "; |
|
|
|
|
|
|
|
|
tryDetermineTermSize(); |
|
|
tryDetermineTermSize(); |
|
|
|
|
|
logRaw("ENVCOL:" + TestUtils.getEnvVar("COLUMNS")); |
|
|
initialized = true; |
|
|
initialized = true; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -40,10 +46,9 @@ public class TestLogger { |
|
|
cmdOutput += buf; |
|
|
cmdOutput += buf; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
log("TERMSIZE: " + cmdOutput); |
|
|
|
|
|
|
|
|
|
|
|
nrCols = Integer.valueOf(cmdOutput); |
|
|
nrCols = Integer.valueOf(cmdOutput); |
|
|
setLineWidth(clip(nrCols, 40, 2000)); |
|
|
setLineWidth(clip(nrCols, 40, 2000)); |
|
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
} catch (Exception e) { |
|
|
// something went wrong
|
|
|
// something went wrong
|
|
|
} |
|
|
} |
|
|