@Test
    public void testLogLevelSetting() {

        // levels are ordered like:
        // C++ has fatal, error, warning, config, info, event, debug, spam
        // Java has fatal, error, warning, event, config, info, debug, spam

        // logctl file values: fatal, error, warning, config, info, event, debug, spam

        System.setProperty("vespa.log.target", "fd:2");
        setupAndCheckLevels(null, "  ON  ON  ON  ON  ON  ON OFF OFF", LogLevel.INFO, LogLevel.DEBUG);
        setupAndCheckLevels("", "  ON  ON  ON  ON  ON  ON OFF OFF", LogLevel.INFO, LogLevel.DEBUG);
        setupAndCheckLevels("all", "  ON  ON  ON  ON  ON  ON  ON  ON", LogLevel.SPAM, null);
        setupAndCheckLevels("all -spam", "  ON  ON  ON  ON  ON  ON  ON OFF", LogLevel.DEBUG, LogLevel.SPAM);
        setupAndCheckLevels("all -debug", "  ON  ON  ON  ON  ON  ON OFF  ON", LogLevel.INFO, null);
        setupAndCheckLevels("all -debug -spam", "  ON  ON  ON  ON  ON  ON OFF OFF", LogLevel.INFO, LogLevel.DEBUG);
        // INFO is higher in level value than CONFIG, so one should rather use -info -config
        setupAndCheckLevels("all -debug -spam -info", "  ON  ON  ON  ON OFF  ON OFF OFF", LogLevel.WARNING, LogLevel.DEBUG);
        setupAndCheckLevels("all -debug -spam -info -config", "  ON  ON  ON OFF OFF  ON OFF OFF", LogLevel.WARNING, LogLevel.INFO);
        setupAndCheckLevels("all debug", "  ON  ON  ON  ON  ON  ON  ON  ON", LogLevel.SPAM, null);
        setupAndCheckLevels("debug", " OFF OFF OFF OFF OFF OFF  ON OFF", null, null);
        setupAndCheckLevels("debug error", " OFF  ON OFF OFF OFF OFF  ON OFF", LogLevel.ERROR, LogLevel.SPAM);
    }
Make sure we can install the logging stuff properly.

@author Bjorn Borud
vespalog/src/test/java/com/yahoo/log/LogSetupTestCase.java