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:eu.ubitech.sma.aggregator.scraper.FacebookClient.java

FacebookClient(Boolean isLoggingEnabled) {
    webClient.getOptions().setThrowExceptionOnFailingStatusCode(false);
    if (!isLoggingEnabled) {
        java.util.logging.Logger.getLogger("com.gargoylesoftware").setLevel(Level.OFF);
        java.util.logging.Logger.getLogger("org.apache.http.client.protocol.ResponseProcessCookies")
                .setLevel(Level.OFF);
    }//w  ww. ja v  a  2  s .  c  o m
}

From source file:com.wegas.integration.IntegrationTest.java

@BeforeClass
public static void setUpClass() throws Exception {
    BootstrapProperties bootstrapProperties = new BootstrapProperties();

    GlassFishProperties glassfishProperties = new GlassFishProperties();
    glassfishProperties.setPort("http-listener-1", 5454);
    glassfishProperties.setPort("http-listener-2", 5353);
    //glassfishProperties.setInstanceRoot("./src/test/glassfish/domains/domain1");
    glassfishProperties.setConfigFileURI(
            (new File("./src/test/glassfish/domains/domain1/config/domain.xml")).toURI().toString());
    //glassfishProperties.setConfigFileReadOnly(false);
    TestHelper.resetTestDB();//  w  w w. jav a2 s  .co  m
    glassfish = GlassFishRuntime.bootstrap(bootstrapProperties).newGlassFish(glassfishProperties);
    Logger.getLogger("javax.enterprise.system.tools.deployment").setLevel(Level.OFF);
    Logger.getLogger("javax.enterprise.system").setLevel(Level.OFF);
    glassfish.start();

    File war = new File("./target/Wegas.war");
    Deployer deployer = glassfish.getDeployer();
    appName = deployer.deploy(war);

    File appDirectory = new File("target/Wegas/");
    Helper.setWegasRootDirectory(appDirectory.getAbsolutePath());
}

From source file:org.jretty.log.Jdk14Logger.java

public static Level getLevel() {
    if (LogManager.getThreshold().equals(org.jretty.log.Level.FATAL)
            || LogManager.getThreshold().equals(org.jretty.log.Level.ERROR)) {
        return Level.SEVERE;
    }//from w  ww  . j a v a2 s  . c om
    if (LogManager.getThreshold().equals(org.jretty.log.Level.WARN)) {
        return Level.WARNING;
    }
    if (LogManager.getThreshold().equals(org.jretty.log.Level.INFO)) {
        return Level.INFO;
    }
    if (LogManager.getThreshold().equals(org.jretty.log.Level.DEBUG)) {
        return Level.FINE;
    }
    if (LogManager.getThreshold().equals(org.jretty.log.Level.TRACE)) {
        return Level.FINEST;
    }
    if (LogManager.getThreshold().equals(org.jretty.log.Level.ALL)) {
        return Level.ALL;
    }
    if (LogManager.getThreshold().equals(org.jretty.log.Level.OFF)) {
        return Level.OFF;
    }
    return Level.INFO;
}

From source file:io.github.bonigarcia.wdm.EdgeDriverManager.java

@Override
public List<URL> getDrivers() throws Exception {
    String edgeDriverUrl = WdmConfig.getString("wdm.edgeDriverUrl");
    log.debug("Reading {} to find out the latest version of Edge driver", edgeDriverUrl);

    // Switch off HtmlUnit logging
    LogFactory.getFactory().setAttribute("org.apache.commons.logging.Log",
            "org.apache.commons.logging.impl.NoOpLog");
    java.util.logging.Logger.getLogger("com.gargoylesoftware.htmlunit").setLevel(Level.OFF);
    java.util.logging.Logger.getLogger("org.apache.commons.httpclient").setLevel(Level.OFF);

    // Using HtmlUnitDriver to read URL and version
    HtmlUnitDriver driver = new HtmlUnitDriver();
    driver.manage().timeouts().implicitlyWait(WdmConfig.getInt("wdm.timeout"), TimeUnit.SECONDS);
    driver.get(edgeDriverUrl);/*  w w  w .j  ava 2 s.  co m*/

    driver.findElement(By.linkText("Details")).click();
    WebElement versionElement = driver
            .findElement(By.xpath("//*[contains(text(), 'Version:')]/parent::*/following-sibling::*"));
    versionToDownload = versionElement.getText();

    driver.findElement(By.linkText("Download")).click();
    WebElement clickHere = driver.findElement(By.linkText("Click here"));
    String downloadLink = clickHere.getAttribute("href");
    List<URL> urlList = new ArrayList<>();
    urlList.add(new URL(downloadLink));

    return urlList;
}

From source file:io.github.bonigarcia.wdm.PhantomJsDriverManager.java

@Override
public List<URL> getDrivers() throws Exception {
    String phantomjsDriverUrl = WdmConfig.getString("wdm.phantomjsDriverUrl");
    log.debug("Reading {} to find out the latest version of PhantomJS driver", phantomjsDriverUrl);

    // Switch off HtmlUnit logging
    LogFactory.getFactory().setAttribute("org.apache.commons.logging.Log",
            "org.apache.commons.logging.impl.NoOpLog");
    java.util.logging.Logger.getLogger("com.gargoylesoftware.htmlunit").setLevel(Level.OFF);
    java.util.logging.Logger.getLogger("org.apache.commons.httpclient").setLevel(Level.OFF);

    // Using HtmlUnitDriver to read package URL
    WebDriver driver = new HtmlUnitDriver();
    driver.manage().timeouts().implicitlyWait(WdmConfig.getInt("wdm.timeout"), TimeUnit.SECONDS);
    driver.get(phantomjsDriverUrl);//from w  w w. ja v  a2 s  .c  o  m
    WebElement downloadsTable = driver.findElement(By.id("available-downloads"));
    List<WebElement> links = downloadsTable.findElements(By
            .xpath("//table[@id='uploaded-files']/tbody/tr[@class='iterable-item']/td[@class='name']" + "/a"));
    List<URL> urlList = new ArrayList<>(links.size());
    for (WebElement element : links) {
        String href = element.getAttribute("href");
        urlList.add(new URL(href));
    }
    return urlList;
}

From source file:com.noelportugal.amazonecho.AmazonEchoApi.java

public AmazonEchoApi(String base_url, String username, String password) {

    this.BASE_URL = base_url;
    this.USERNAME = username;
    this.PASSWORd = password;
    fLogger.setLevel(Level.OFF);
}

From source file:virgil.meanback.HistoryInfo.java

/**
 *
 * @param url//from   w  w w.j  a v a 2 s . c  o  m
 * @return
 * @throws Exception
 */
@SuppressWarnings("")
public Stock parse(String url) throws Exception {
    java.util.logging.Logger.getLogger("com.gargoylesoftware.htmlunit").setLevel(Level.OFF);
    Stock stock = new Stock();
    List<DayInfo> list = new ArrayList<>();
    /**
     * HtmlUnitweb?
     */
    WebClient wc = new WebClient(BrowserVersion.CHROME);
    wc.getOptions().setUseInsecureSSL(true);
    wc.getOptions().setJavaScriptEnabled(true); // ?JStrue  
    wc.getOptions().setCssEnabled(false); // ?css?  
    wc.getOptions().setThrowExceptionOnScriptError(false); // js??  
    wc.getOptions().setTimeout(50000); //  10S0?  
    wc.getOptions().setDoNotTrackEnabled(false);
    HtmlPage page = wc.getPage(url);
    HtmlElement documentElement = page.getDocumentElement();
    Document doc = Jsoup.parse(documentElement.asXml());
    String name = doc.select("#BIZ_IS_Name").text();
    String code = doc.select(".BIZ_IS_price_id span").text();
    code = code.substring(code.indexOf("(") + 2, code.length() - 1);
    Elements els = doc.select("#BIZ_hq_historySearch tbody tr");
    stock.setCode(code);
    stock.setName(name);
    int count = 0;
    for (Element el : els) {
        if (!el.html().contains("sum")) {
            DayInfo dayInfo = new DayInfo();
            String dateString = el.select("td.e1").text();
            SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
            Date date = format.parse(dateString);
            String open = el.select("td").eq(1).text();
            String close = el.select("td").eq(2).text();
            double cd = Double.parseDouble(close);
            String low = el.select("td").eq(5).text();
            String high = el.select("td").eq(6).text();
            String volume = el.select("td").eq(7).text();
            dayInfo.setClose(close);
            dayInfo.setDateString(dateString);
            dayInfo.setHigh(high);
            dayInfo.setLow(low);
            dayInfo.setOpen(open);
            dayInfo.setVolume(volume);
            dayInfo.setDate(date);
            list.add(dayInfo);
            count++;
            if (list.size() > 79) {
                break;
            }
        }
    }
    stock.setList(list);
    return stock;
}

From source file:org.geotools.util.logging.CommonsLogger.java

/**
 * Returns the level for this logger.//  w  ww.  ja  va 2s. com
 */
public Level getLevel() {
    if (logger.isTraceEnabled())
        return Level.FINEST;
    if (logger.isDebugEnabled())
        return Level.FINE;
    if (logger.isInfoEnabled())
        return Level.CONFIG;
    if (logger.isWarnEnabled())
        return Level.WARNING;
    if (logger.isErrorEnabled())
        return Level.SEVERE;
    if (logger.isFatalEnabled())
        return Level.SEVERE;
    return Level.OFF;
}

From source file:jenkins.plugins.publish_over_ftp.BapFtpClientTest.java

@BeforeClass
public static void before() {
    originalLogLevel = BFTP_CLIENT_LOGGER.getLevel();
    BFTP_CLIENT_LOGGER.setLevel(Level.OFF);
}

From source file:pe.chalk.takoyaki.Staff.java

public Staff(PrefixedLogger logger, int timeout, String encoding, JSONObject accountProperties) {
    super(BrowserVersion.CHROME);
    this.getOptions().setTimeout(timeout);
    this.getOptions().setJavaScriptEnabled(false);
    this.getOptions().setCssEnabled(false);

    this.encoding = encoding;
    this.logger = logger;

    Logger.getLogger("org.apache").setLevel(Level.OFF);
    Logger.getLogger("com.gargoylesoftware").setLevel(Level.OFF);

    if (accountProperties != null)
        this.login(accountProperties);
}