Example usage for java.util.logging Level INFO

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

Introduction

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

Prototype

Level INFO

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

Click Source Link

Document

INFO is a message level for informational messages.

Usage

From source file:com.minhthuong.pfi.controller.PFIViewController.java

private void addHeaders(RenderRequest request, RenderResponse response) {
    log.log(Level.INFO, "show.edit.START");

    Element cssElement = response.createElement("link");
    cssElement.setAttribute("rel", "stylesheet");
    cssElement.setAttribute("type", "text/css");
    //cssElement.setAttribute("href",
    //response.encodeURL("http://twitter.github.com/bootstrap/1.4.0/bootstrap.min.css"));
    cssElement.setAttribute("href", response.encodeURL(request.getContextPath() + "/bootstrap/bootstrap.css"));
    response.addProperty(MimeResponse.MARKUP_HEAD_ELEMENT, cssElement);

    cssElement = response.createElement("link");
    cssElement.setAttribute("rel", "stylesheet");
    cssElement.setAttribute("type", "text/css");
    cssElement.setAttribute("href", response.encodeURL((request.getContextPath() + "/css/list.css")));
    response.addProperty(MimeResponse.MARKUP_HEAD_ELEMENT, cssElement);

    Element jsElement = response.createElement("script");
    jsElement.setAttribute("src", response.encodeURL((request.getContextPath() + "/js/jquery.js")));
    response.addProperty(MimeResponse.MARKUP_HEAD_ELEMENT, jsElement);

    jsElement = response.createElement("script");
    jsElement.setAttribute("src", response.encodeURL((request.getContextPath() + "/js/jquery.dataTables.js")));
    response.addProperty(MimeResponse.MARKUP_HEAD_ELEMENT, jsElement);

    jsElement = response.createElement("script");
    jsElement.setAttribute("type", "text/javascript");
    jsElement.setAttribute("src", response.encodeURL((request.getContextPath() + "/js/list.js")));
    response.addProperty(MimeResponse.MARKUP_HEAD_ELEMENT, jsElement);
}

From source file:eu.edisonproject.training.wsd.Wikipedia.java

@Override
public Term getTerm(String term)
        throws IOException, ParseException, MalformedURLException, UnsupportedEncodingException {
    Set<Term> possibleTerms = null;
    try {//from   w  ww.ja  v a  2  s .  c om
        possibleTerms = getCandidates(term);
    } catch (InterruptedException | ExecutionException ex) {
        Logger.getLogger(Wikipedia.class.getName()).log(Level.SEVERE, null, ex);
    }
    String delimeter = ",";
    String wordSeperator = " ";
    Set<String> ngarms = CSVFileReader.getNGramsForTerm(term, getItemsFilePath(), delimeter, wordSeperator);
    Term dis = super.disambiguate(term, possibleTerms, ngarms, getMinimumSimilarity());
    if (dis == null) {
        Logger.getLogger(Wikipedia.class.getName()).log(Level.INFO, "Couldn''''t figure out what ''{0}'' means",
                term);
    } else {
        Logger.getLogger(Wikipedia.class.getName()).log(Level.INFO, "Term: {0}. Confidence: {1} URL: {2}",
                new Object[] { dis, dis.getConfidence(), dis.getUrl() });
    }
    return dis;
}

From source file:com.neophob.sematrix.core.output.tpm2.Tpm2Serial.java

/**
 * Create a new instance to communicate with the rainbowduino.
 *
 * @param app the app//from w w w.  jav  a  2 s .c o m
 * @param portName the port name
 * @throws NoSerialPortFoundException the no serial port found exception
 */
public Tpm2Serial(String portName, int baud) throws IllegalArgumentException, NoSerialPortFoundException {

    LOG.log(Level.INFO, "Initialize Tpm2Serial lib v{0}", VERSION);

    this.baud = baud;

    lastDataMap = 0L;

    String serialPortName = "";

    if (StringUtils.isNotBlank(portName)) {
        //open specific port
        LOG.log(Level.INFO, "Open specific port: {0}", portName);
        serialPortName = portName;
        openPort(portName);
    } else {
        //try to find the port
        String[] ports = Serial.list();
        for (int i = 0; port == null && i < ports.length; i++) {
            LOG.log(Level.INFO, "Open port: {0}", ports[i]);
            try {
                serialPortName = ports[i];
                openPort(ports[i]);
                //catch all, there are multiple exception to catch (NoSerialPortFoundException, PortInUseException...)
            } catch (Exception e) {
                // search next port...
            }
        }
    }

    if (port == null) {
        throw new NoSerialPortFoundException("Error: no serial port found!");
    }

    LOG.log(Level.INFO, "found serial port: " + serialPortName);
}

From source file:org.newinstance.tnt.view.TaskBean.java

/**
 * Create a new task.//w ww.  j av  a2s.  c o m
 *
 * @return the edit task view
 */
public String createTask() {
    LOG.log(Level.INFO, "Initialising new task...");
    task = taskService.createTask();
    return "showCreateTask";
}

From source file:com.grameenfoundation.ictchallenge.controllers.ConnectedAppREST.java

protected void processRequest(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {
    response.setContentType("text/html;charset=UTF-8");
    try (PrintWriter out = response.getWriter()) {

        JSONObject farmers;/*from  ww w  .jav  a2  s.c  om*/
        String accessToken = (String) request.getSession().getAttribute(ACCESS_TOKEN);

        String instanceUrl = (String) request.getSession().getAttribute(INSTANCE_URL);

        if (accessToken == null) {
            out.write("Error - no access token");
            return;
        }

        log.log(Level.INFO, "We have an access token: {0}" + "\n" + "Using instance {1}\n\n",
                new Object[] { accessToken, instanceUrl });
        //out.write("We have an access token: " + accessToken + "\n"
        //+ "Using instance " + instanceUrl + "\n\n");

        if (request.getParameter("action").equals("search")) {
            farmers = getFarmerById(instanceUrl, accessToken, request.getParameter("farmer_id"));
        } else
            farmers = showFarmers(instanceUrl, accessToken);

        if (null != farmers) {
            request.getSession().setAttribute("All_Farmer", farmers);
        } else {
            log.info("Data could not be retrieved from salesforce");
        }

        response.sendRedirect(request.getContextPath() + "/farmer_details.jsp");

    }

}

From source file:net.chrissearle.spring.twitter.spring.Twitter4jFollowService.java

@Override
public void unfollow(String twitterUserId) {
    if (logger.isLoggable(Level.INFO)) {
        logger.info(new StringBuilder().append("Stopping following: ").append(twitterUserId).toString());
    }/*from   w ww  .j a v a  2 s .c  o m*/

    if (isActive()) {
        removeTwitterFriendshipAndNotification(twitterUserId);
    } else {
        if (logger.isLoggable(Level.INFO)) {
            logger.info("Twitter disabled");
        }
    }
}

From source file:com.silverpeas.openoffice.OfficeLauncher.java

/**
 * Launch document edition//from   w  w w . ja v a 2s  .co  m
 * @param path path to editor
 * @param url document url
 * @param modeDisconnected disconnected mode (used under vista + MS Office 2007)
 * @param auth authentication info
 * @return status
 * @throws IOException
 * @throws InterruptedException
 */
public static int launch(String path, String url, boolean modeDisconnected, AuthenticationInfo auth)
        throws IOException, InterruptedException {
    logger.log(Level.INFO, "The path: {0}", path);
    logger.log(Level.INFO, "The url: {0}", url);
    logger.log(Level.INFO, "The command line: {0} {1}", new Object[] { path, url });
    if (modeDisconnected) {
        try {
            String webdavUrl = url;
            final FileWebDavAccessManager webdavAccessManager = new FileWebDavAccessManager(auth);
            if ('"' == url.charAt(0)) {
                webdavUrl = url.substring(1, url.length() - 1);
            }
            String tmpFilePath = webdavAccessManager.retrieveFile(webdavUrl);
            logger.log(Level.INFO, "The exact exec line: {0} {1}", new Object[] { path, tmpFilePath });
            Process process = Runtime.getRuntime().exec(path + ' ' + tmpFilePath);
            process.waitFor();
            webdavAccessManager.pushFile(tmpFilePath, url);
            MessageDisplayer.displayMessage(MessageUtil.getMessage("info.ok"));
            return 0;
        } catch (HttpException ex) {
            logger.log(Level.SEVERE, null, ex);
            throw new IOException(ex);
        } catch (IOException ex) {
            logger.log(Level.SEVERE, null, ex);
            throw ex;
        }
    } else {
        // Standard mode : just open it
        logger.log(Level.INFO, "The exact exec line: {0} {2}", new Object[] { path, url });
        Process process = Runtime.getRuntime().exec(path + ' ' + url);
        return process.waitFor();
    }
}

From source file:demo.service.CustomerService.java

@POST
@Consumes("application/json")
public Response updateCustomer(final Customer customer) {
    Validate.notNull(customer);/*w ww .ja  v  a  2 s .  c  o m*/

    LOGGER.log(Level.FINE, "Invoking updateCustomer, customer={0}", customer);

    if (isCustomerExists(customer)) {
        LOGGER.log(Level.FINE, "Specified customer exists, update data, customer={0}", customer);
    } else {
        LOGGER.log(Level.WARNING, "Specified customer does not exist, add data, customer={0}", customer);
    }

    customers.put(customer.getId(), customer);

    LOGGER.log(Level.INFO, "Customer was updated successful, customer={0}", customer);
    return Response.ok().build();
}

From source file:com.sios.stc.coseng.util.TestParam.java

public synchronized Boolean isValid(final LocalParam localParam) throws IOException {
    Boolean isValid = true;/*from w ww  .  j a  va  2  s . co  m*/
    // Warning items that don't necessarily invalidate the config
    if ((baseUrl == null) || baseUrl.isEmpty()) {
        TestParam.log.log(Level.WARNING, logDetails("A baseUrl was not provided; some tests may fail"));
    }
    if (verbosity == null) {
        TestParam.log.log(Level.INFO, logDetails("A verbosity was not provided; assuming level (0)"));
        verbosity = 0;
    }
    if (spot == null) {
        TestParam.log.log(Level.INFO, logDetails("A spot was not provided; assuming LOCAL"));
        spot = Spot.LOCAL;
    }
    // True|False validation parameters
    if (platform == null) {
        TestParam.log.log(Level.SEVERE, logDetails(
                "No platform was provided; a platform of (" + getPlatformOptions() + ") is REQUIRED"));
        isValid = false;
    }
    if (browser == null) {
        TestParam.log.log(Level.SEVERE,
                logDetails("No browser was provided; a browser of (" + getBrowserOptions() + ") is REQUIRED"));
        isValid = false;
    }
    // Special; chromeDriver|ieDriver when Spot.LOCAL and !Browser.FIREFOX
    if ((browser != null) && (spot == Spot.LOCAL)) {
        if (browser == Browser.CHROME) {
            // If can't find chromeDriver; bail
            final File chromeDriver = localParam.getChromeDriver();
            if ((chromeDriver == null) || !chromeDriver.exists() || !chromeDriver.canExecute()) {
                TestParam.log.log(Level.SEVERE,
                        logDetails(
                                "Testing with browser (" + browser.toString() + ") at spot (" + spot.toString()
                                        + ") REQUIRES chromeDriver. Could not find executable chromeDriver ("
                                        + chromeDriver + ")"));
                isValid = false;
            }
        } else if (browser != Browser.FIREFOX) {
            // Must be IE*
            final File ieDriver = localParam.getIeDriver();
            // If can't find ieDriver; bail
            if ((ieDriver == null) || !ieDriver.exists() || !ieDriver.canExecute()) {
                TestParam.log.log(Level.SEVERE,
                        logDetails("Testing with browser (" + browser.toString() + ") at spot ("
                                + spot.toString() + ") REQUIRES ieDriver. Could not find executable ieDriver ("
                                + ieDriver + ")"));
                isValid = false;
            }
        }
    }
    // If !windows but browser is IE*; bail
    if ((browser != null) && (platform != null)) {
        if (platform != Platform.WINDOWS) {
            if ((browser != Browser.FIREFOX) && (browser != Browser.CHROME)) {
                TestParam.log.log(Level.SEVERE,
                        logDetails("Internet Explorer IE*, any version; REQUIRES platform WINDOWS"));
                isValid = false;
            }
        }
    }
    if ((suite == null) || suite.isEmpty()) {
        TestParam.log.log(Level.SEVERE, logDetails("No suite provided; at least one suite XML REQUIRED"));
        isValid = false;
    } else {
        // jarSuiteTempDirectory is checked in findTestSuite
        if (!findTestSuite(localParam)) {
            TestParam.log.log(Level.SEVERE, logDetails("Could not find ALL suite (" + suite.toString() + ")"));
            isValid = false;
        }
    }
    if ((spot == Spot.GRID) && ((gridUrl == null) || gridUrl.isEmpty())) {
        TestParam.log.log(Level.SEVERE,
                logDetails("A gridUrl was not provided; spot (" + spot.toString() + ") REQUIRES gridUrl"));
        isValid = false;
    }
    if (!setTestReportDirectory(localParam)) {
        TestParam.log.log(Level.SEVERE, logDetails(
                "Could not create testReportDirectory (" + testReportDirectory.getCanonicalPath() + ")"));
        isValid = false;
    }
    if ((verbosity < 0) || (verbosity > 10)) {
        TestParam.log.log(Level.SEVERE, logDetails("Invalid verbosity; must be 0-10"));
        isValid = false;
    }
    setIsValid(isValid);
    return isValid;
}

From source file:de.static_interface.sinklibrary.util.Debug.java

public static void log(@Nonnull Object o) {
    logInternal(Level.INFO, (o == null ? "null" : o.toString()), null);
}