Browse Source

PityTest: TestLogger - correct static initialization

JNI-146
heck 4 years ago
parent
commit
3002300556
  1. 17
      test/java/foundation/pEp/pitytest/TestLogger.java

17
test/java/foundation/pEp/pitytest/TestLogger.java

@ -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
} }

Loading…
Cancel
Save