Example usage for java.util.logging Level FINE

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

Introduction

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

Prototype

Level FINE

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

Click Source Link

Document

FINE is a message level providing tracing information.

Usage

From source file:br.gov.sc.fatma.resourcemanager.commands.SiteCheckIfUPCommand.java

@Override
public Status execute() {
    Logger.getLogger(SiteCheckIfUPCommand.class.getName()).log(Level.FINE,
            "-------- " + _site.getPath() + " Connection Testing ------");
    Status result;//from   ww w  .java 2 s. c o  m
    CloseableHttpClient httpclient = HttpClients.createDefault();
    try {
        HttpGet httpget = new HttpGet(_site);
        Logger.getLogger(SiteCheckIfUPCommand.class.getName()).log(Level.INFO,
                "Executing request " + httpget.getRequestLine());

        ResponseHandler<String> responseHandler = new BasicResponseHandler() {
            @Override
            public String handleResponse(final HttpResponse response)
                    throws ClientProtocolException, IOException {
                int status = response.getStatusLine().getStatusCode();
                if (status >= 200 && status < 300) {
                    return "200";
                } else {
                    return String.valueOf(status);
                }
            }
        };
        String responseBody = httpclient.execute(httpget, responseHandler);
        result = new Status(responseBody.equals("200"), "", Integer.valueOf(responseBody));
    } catch (IOException ex) {
        Logger.getLogger(SiteCheckIfUPCommand.class.getName()).log(Level.WARNING, ex.getMessage(), ex);
        ex.printStackTrace();
        result = new Status(false, ex.getMessage(), -1);
    } finally {
        try {
            httpclient.close();
        } catch (IOException ex) {
        }
    }

    return result;
}

From source file:net.nharyes.drivecopy.Main.java

public static void main(String[] args) {

    // set logger handler
    Logger logger = Logger.getLogger(Main.class.getPackage().getName());
    logger.setUseParentHandlers(false);/*from   w ww .jav  a2s .c o m*/
    logger.addHandler(new SystemOutHandler());
    logger.setLevel(Level.FINE);

    new Main(args);
}

From source file:com.google.code.jahath.common.http.HttpOutputStream.java

public void writeLine(String s) throws IOException {
    if (log.isLoggable(Level.FINE)) {
        log.fine(s);/*  w  w w . ja  v a 2s.c om*/
    }
    int len = s.length();
    byte[] bytes = new byte[len + 2];
    for (int i = 0; i < len; i++) {
        bytes[i] = (byte) s.charAt(i);
    }
    bytes[len] = '\r';
    bytes[len + 1] = '\n';
    write(bytes);
}

From source file:com.boundlessgeo.geoserver.api.exceptions.AppExceptionHandler.java

@ExceptionHandler(Exception.class)
public @ResponseBody JSONObj error(Exception e, HttpServletResponse response) {

    HttpStatus status = status(e);/*  www.jav a  2 s.c o  m*/
    response.setStatus(status.value());

    // log at warning if 500, else debug
    LOG.log(status == HttpStatus.INTERNAL_SERVER_ERROR ? Level.WARNING : Level.FINE, e.getMessage(), e);
    return IO.error(new JSONObj(), e);
}

From source file:com.joyfulmongo.controller.JFMultiInput.java

public List<JFCommandInput> getCommands() {
    List<JFCommandInput> commands = new ArrayList<JFCommandInput>();
    JSONArray array = getJSONArray(JFCConstants.Props.commands.toString());
    for (int i = 0; i < array.length(); i++) {
        JSONObject json = array.getJSONObject(i);
        if (LOGGER.isLoggable(Level.FINE)) {
            LOGGER.fine("  Command multi-input " + json);
        }/*from  ww  w.  j a  va2s  . c  o m*/
        JFCommandInput command = new JFCommandInput(json);
        commands.add(command);
    }

    return commands;
}

From source file:net.pracxs.angularjs.web.controllers.MenuController.java

@RequestMapping(method = RequestMethod.GET, produces = "application/json")
public List<MenuCategory> showAll() throws IOException, ServletException {
    log.log(Level.FINE, "Process request GET /menu-item/");

    return menuService.getMenu();
}

From source file:com.willwinder.universalgcodesender.gcode.util.GcodeParserUtils.java

/**
 * Common logic in processAndExport* methods.
 *//*from w  w w.  j a va2s  .c om*/
private static void write(GcodeParser gcp, GcodeStreamWriter gsw, String original, String command,
        String comment, int idx) throws GcodeParserException {
    if (idx % 100000 == 0) {
        logger.log(Level.FINE, "gcode processing line: " + idx);
    }

    if (StringUtils.isEmpty(command)) {
        gsw.addLine(original, command, comment, idx);
    } else {
        // Parse the gcode for the buffer.
        Collection<String> lines = gcp.preprocessCommand(command, gcp.getCurrentState());

        for (String processedLine : lines) {
            gsw.addLine(original, processedLine, comment, idx);
        }

        gcp.addCommand(command);
    }
}

From source file:net.pracxs.angularjs.web.controllers.LoginController.java

/**
 * Forms response for the <i>get</i> method
 *///from   ww  w .j ava 2  s . c  om
@RequestMapping(method = RequestMethod.GET)
@ResponseBody
public String showLogin() throws IOException, ServletException {
    log.log(Level.FINE, "Process request GET /login");

    // return userRepo.toString();
    if (userRepo == null)
        return "No user repo";

    final User login = userRepo.find("ivan@pracxs.com", "Password@1");

    if (login == null)
        return "No user";

    return login.getFirstName() + " " + login.getLastName();
}

From source file:net.sourceforge.hypo.inject.resolver.RegExSpringBeanResolver.java

public ResolutionResult doResolve(Dependency dep, Object target) {
    String beanName = mapper.getMappedString(dep.getType());
    if (beanName != null) {
        Object bean = applicationContext.getBean(beanName, dep.getType());
        if (log.isLoggable(Level.FINE))
            log.fine("Found bean [" + bean + "] to inject for dependency " + dep + ".");
        return ResolutionResult.resolved(bean);
    } else/*from   w w w.j a  va2 s .  c om*/
        return ResolutionResult.couldNotResolve();
}

From source file:de.blinkenlights.bmix.main.Daemon.java

public void init(DaemonContext arg0) throws Exception {
    int verbosity = 1;
    if (System.getProperty("debugLevel") != null) {
        verbosity = Integer.parseInt(System.getProperty("debugLevel"));
    }/*from   www .  j  av  a2s .c om*/
    Level logLevel;
    if (verbosity == 0) {
        logLevel = Level.WARNING;
    } else if (verbosity == 1) {
        logLevel = Level.INFO;
    } else if (verbosity == 2) {
        logLevel = Level.FINE;
    } else if (verbosity >= 3) {
        logLevel = Level.FINEST;
    } else {
        System.err.println("Fatal Error: Invalid log verbosity: " + verbosity);
        return;
    }
    System.err.println("Setting log level to " + logLevel);
    Logger.getLogger("").setLevel(logLevel);
    for (Handler handler : Logger.getLogger("").getHandlers()) {
        handler.setLevel(logLevel);
    }

    bmix = new BMix("bmix.xml", false);
}