Example usage for java.util.logging Level OFF

List of usage examples for java.util.logging Level OFF

Introduction

In this page you can find the example usage for java.util.logging Level OFF.

Prototype

Level OFF

To view the source code for java.util.logging Level OFF.

Click Source Link

Document

OFF is a special level that can be used to turn off logging.

Usage

From source file:pt.ua.tm.neji.dictionary.DictionariesLoader.java

private Matcher getExactMatcher(String fileName, boolean ignoreCase) {
    Boolean b = ignoreCase;//from  w w w.j  av  a  2 s . com
    ArgParser ap = new ArgParser(new String[] { "--variantMatcher", fileName, "--ignoreCase", b.toString() });

    java.util.logging.Logger l = Loggers.getDefaultLogger(ap);
    if (Constants.verbose) {
        l.setLevel(Level.INFO);
    } else {
        l.setLevel(Level.OFF);
    }

    return EntityTagger.getMatcher(ap, l);
}

From source file:joliex.mongodb.MongoDbConnector.java

@RequestResponse
public void connect(Value request) throws FaultException {
    try {//from   w  ww  . ja  v a2  s.  co m
        host = request.getFirstChild("host").strValue();
        port = request.getFirstChild("port").intValue();
        dbname = request.getFirstChild("dbname").strValue();
        timeZone = request.getFirstChild("timeZone").strValue();
        password = request.getFirstChild("password").strValue();
        username = request.getFirstChild("username").strValue();
        log = Logger.getLogger("org.mongodb.driver");
        log.setLevel(Level.OFF);
        if (request.hasChildren("jsonStringDebug")) {
            jsonDebuger = request.getFirstChild("jsonStringDebug").boolValue();
        }
        if (request.hasChildren("logStreamDebug")) {
            logStream = request.getFirstChild("logStreamDebug").boolValue();
            logString = "Processing Steps at " + System.currentTimeMillis();
        }
        if (System.getProperty("os.arch").contains("64")) {
            is64 = true;
        } else {
            is64 = false;
        }

        zone = DateTimeZone.forID(timeZone);

        ServerAddress serverAddress = new ServerAddress(host, port);
        MongoCredential credential = MongoCredential.createCredential(username, dbname, password.toCharArray());
        mongoClientOptions = MongoClientOptions.builder().build();

        if (null != mongoClient) {
            System.out.println("recovering client");
            db = mongoClient.getDatabase(dbname);
        } else {

            mongoClient = new MongoClient(serverAddress, credential, mongoClientOptions);
            db = mongoClient.getDatabase(dbname);
        }

    } catch (MongoException ex) {
        throw new FaultException("LoginConnection", ex);
    }
}

From source file:name.richardson.james.bukkit.utilities.persistence.database.AbstractDatabaseLoader.java

@Override
public final void load() {
    logger.log(Level.FINE, "Loading database.");
    final Level level = java.util.logging.Logger.getLogger("").getLevel();
    java.util.logging.Logger.getLogger("").setLevel(Level.OFF);
    ClassLoader currentClassLoader = null;
    try {/*from  w  w w . ja va2s . c o m*/
        this.serverConfig.setClasses(this.classes);
        if (logger.isLoggable(Level.ALL)) {
            this.serverConfig.setLoggingToJavaLogger(true);
            this.serverConfig.setLoggingLevel(LogLevel.SQL);
        }
        // suppress normal ebean warnings and notifications
        currentClassLoader = Thread.currentThread().getContextClassLoader();
        Thread.currentThread().setContextClassLoader(this.classLoader);
        this.ebeanserver = EbeanServerFactory.create(this.serverConfig);
    } finally {
        // re-enable logging
        java.util.logging.Logger.getLogger("").setLevel(level);
        if (currentClassLoader != null) {
            Thread.currentThread().setContextClassLoader(currentClassLoader);
        }
    }
}

From source file:hudson.util.XStream2Test.java

private Level disableLogging() {
    Level oldLevel = Logger.getLogger(RobustReflectionConverter.class.getName()).getLevel();
    Logger.getLogger(RobustReflectionConverter.class.getName()).setLevel(Level.OFF);
    return oldLevel;
}

From source file:RouterControl.Switch.java

public void restartDSL(String ip, String U, String P) throws IOException { //dslx_modulation
    String username = en.decrypt(U);
    String password = en.decrypt(P);
    System.setProperty("org.apache.commons.logging.Log", "org.apache.commons.logging.impl.NoOpLog");
    java.util.logging.Logger.getLogger("com.gargoylesoftware").setLevel(Level.OFF);
    page = webClient.getPage("http://" + ip + "/Advanced_ADSL_Content.asp");
    JavaScriptEngine engine = new JavaScriptEngine(webClient);
    webClient.setJavaScriptEngine(engine);

    textField1 = page.getHtmlElementById("login_username");
    textField1.setValueAttribute(username);
    textField = page.getElementByName("login_passwd");
    textField.setValueAttribute(password);

    JSCode = "login()";
    result = page.executeJavaScript(JSCode);
    Object jsResult = result.getJavaScriptResult();
    page = (HtmlPage) result.getNewPage();
    page = webClient.getPage("http://" + ip + "/Advanced_ADSL_Content.asp"); //Redirect, as the program as it has been authed            

    HtmlSelect select = (HtmlSelect) page.getElementByName("dslx_modulation");
    int newOption = 4;
    if (select.getSelectedIndex() == 4) {
        newOption = 6;/*from  w  ww.  j a  v  a  2s  .  c o  m*/
    }
    select.setSelectedIndex(newOption);
    JSCode = "applyRule();";
    result = page.executeJavaScript(JSCode);
    result.getNewPage();
    JSCode = "logout();";
    result = page.executeJavaScript(JSCode);
    result.getNewPage(); //Fix confirm box
    username = null;
    password = null;
}

From source file:com.ebixio.virtmus.stats.StatsLogger.java

private StatsLogger() {
    try {/*w  w  w  . j  a v  a2  s .  c om*/

        statsLog.setUseParentHandlers(false);
        statsLog.setLevel(Level.ALL);

        Logger uiLogger = Logger.getLogger("org.netbeans.ui");
        // org.netbeans.ui.focus = maybe too much info

        uiLogger.setUseParentHandlers(false);
        uiLogger.setLevel(Level.ALL);

        logSet = pref.get(Options.OptLogSet, "A");
        if (!changeHandler(makeLogHandler(logSet))) {
            Log.log("Stats logging init failed.");
            statsLog.setLevel(Level.OFF);
            uiLogger.setLevel(Level.OFF);
        }

    } catch (SecurityException ex) {
        Log.log(ex);
    }
}

From source file:org.geoserver.kml.GeoSearchKMLTest.java

/**
 * Test that when a bogus regionating strategy is requested things still work.
 * TODO: Evaluate whether an error message should be returned instead.
 *//*from   w w w . ja va2 s  .co  m*/
@Test
public void testBogusRegionator() throws Exception {
    Logging.getLogger("org.geoserver.ows").setLevel(Level.OFF);
    final String path = "wms?request=getmap&service=wms&version=1.1.1" + "&format="
            + KMLMapOutputFormat.MIME_TYPE + "&layers=" + MockData.DIVIDED_ROUTES.getPrefix() + ":"
            + MockData.DIVIDED_ROUTES.getLocalPart() + "&styles=" + MockData.DIVIDED_ROUTES.getLocalPart()
            + "&height=1024&width=1024&srs=EPSG:4326" + "&format_options=regionateBy:bogus";
    Document document = getAsDOM(path + "&bbox=0,-90,180,90", true);
    assertEquals("ServiceExceptionReport", document.getDocumentElement().getTagName());
}

From source file:net.atos.aeon.AEONSDK.java

private void Init(String subscribeUrl, String id, String desc) {

    this.messages = new AEONSDKMessages();

    try {//from ww w.ja  v  a 2 s. c  o  m
        if (subscribeUrl.indexOf("/subscribe") != -1) {
            if (subscribeUrl.startsWith("https")) {

                this.webClient = ClientHelper.createClient();

                SSLContext sc = SSLContext.getInstance("TLS");
                sc.init(null, ClientHelper.trustAllCerts, new SecureRandom());
                SocketIO.setDefaultSSLSocketFactory(sc);
                HttpsURLConnection.setDefaultHostnameVerifier(new RelaxedHostNameVerifier());

            } else
                this.webClient = Client.create();

            this.subscribeUrl = subscribeUrl;
            this.socketServer = getSocketServerEndpoint(getServerEndpoint(subscribeUrl));

            this.socket = new SocketIO(socketServer);
            this.socket.addHeader("force_new_connection", "true");
            // this.socket.addHeader("transports", "xhr-polling");
            // this.socket.addHeader("polling duration", "20");

            this.id = id;
            this.desc = desc;
            this.mode = "subscribe";
            sioLogger.setLevel(Level.OFF);
        } else
            this.mode = "error";
    } catch (MalformedURLException e) {
        e.printStackTrace();
        this.mode = "error";
    } catch (NoSuchAlgorithmException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
        this.mode = "error";
    } catch (KeyManagementException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
        this.mode = "error";
    }

}

From source file:org.apache.geode.management.internal.cli.shell.GfshConfig.java

public boolean isLoggingEnabled() {
    // keep call for getLogLevel() instead of logLevel for inheritance
    return !Level.OFF.equals(getLogLevel());
}

From source file:edu.illinois.cs.cogcomp.temporal.normalizer.main.TemporalNormalizerBenchmark.java

/**
 * Normalize the dataset using real extraction
 * @param outputFolder/*from ww  w. ja  va2 s.  c  om*/
 * @param verbose
 * @throws Exception
 */
public void testNormalizationWithTrueExtraction(String outputFolder, boolean verbose) throws Exception {
    TextAnnotationBuilder tab = new TokenizerTextAnnotationBuilder(new StatefulTokenizer(false, false));
    System.out.println("Working Directory = " + System.getProperty("user.dir"));
    ResourceManager nerRm = new TemporalChunkerConfigurator().getDefaultConfig();
    IOUtilities.existsInClasspath(TemporalChunkerAnnotator.class, nerRm.getString("modelDirPath"));

    java.util.logging.Logger.getLogger("HeidelTimeStandalone").setLevel(Level.OFF);

    long preprocessTime = System.currentTimeMillis();
    List<TextAnnotation> taList = new ArrayList<>();
    POSAnnotator annotator = new POSAnnotator();
    for (int j = 0; j < te3inputText.size(); j++) {
        String text = testText.get(j);
        text = text.replaceAll("\\n", " ");
        TextAnnotation ta = tab.createTextAnnotation("corpus", "id", text);
        try {
            annotator.getView(ta);
        } catch (AnnotatorException e) {
            fail("AnnotatorException thrown!\n" + e.getMessage());
        }

        taList.add(ta);
    }

    long startTime = System.currentTimeMillis();

    int numTimex = 0;

    File outDir = new File(outputFolder);
    if (!outDir.exists()) {
        outDir.mkdir();
    }

    for (int j = 0; j < te3inputText.size(); j++) {
        TextAnnotation ta = taList.get(j);
        tca.addDocumentCreationTime(DCTs.get(j));

        if (verbose) {
            System.out.println(docIDs.get(j));
        }

        try {
            List<TimexChunk> timex = tca.extractTimexFromFile(te3inputText.get(j), testText.get(j), ta,
                    verbose);

            tca.setTimex(timex);
            String outputFileName = outputFolder + "/" + docIDs.get(j) + ".tml";

            tca.write2Text(outputFileName, docIDs.get(j), testText.get(j));
            numTimex += timex.size();
            tca.deleteTimex();
        } catch (AnnotatorException e) {
            fail("Exception while adding TIMEX3 VIEW " + e.getStackTrace());
        }

    }
    long endTime = System.currentTimeMillis();
    long totalTime = endTime - startTime;
    System.out.println("Process time: " + totalTime);
    System.out.println("Preprocess + process time: " + (endTime - preprocessTime));
    System.out.println("Total timex3: " + numTimex);

}