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.massabot.codesender.utils.SettingsFactory.java

public static Settings loadSettings() {
    migrateOldSettings();// w  w  w  .j  a  v a  2  s . c  o  m

    // the defaults are now in the settings bean
    Settings out = null;
    File settingsFile = getSettingsFile();

    if (!settingsFile.exists()) {
        out = new Settings();
    } else {
        try {
            // logger.log(Level.INFO, "{0}: {1}", new
            // Object[]{Localization.getString("settings.log.location"), settingsFile});
            logger.log(Level.INFO, "Log location: {0}", settingsFile.getAbsolutePath());
            logger.info("Loading settings.");
            out = new Gson().fromJson(new FileReader(settingsFile), Settings.class);
            if (out != null) {
                out.finalizeInitialization();
            }
            // Localized setting not available here.
            // logger.info(Localization.getString("settings.log.loading"));
        } catch (FileNotFoundException ex) {
            // logger.warning(Localization.getString("settings.log.error"));
            logger.log(Level.SEVERE, "Can't load settings, using defaults.", ex);
        }
    }

    if (out == null)
        return new Settings();
    return out;
}

From source file:com.pamarin.servlet.uploadfile.UploadFileServet.java

@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {
    LOG.log(Level.INFO, "uploaded");

    try {/*from ww  w.  jav  a2 s.c  om*/
        if (!ServletFileUpload.isMultipartContent(request)) {
            return;
        }

        LOG.log(Level.INFO, "is multipart");
        DiskFileItemFactory factory = new DiskFileItemFactory();
        factory.setSizeThreshold(maxMemSize);
        factory.setRepository(new File("c:\\temp"));
        //
        ServletFileUpload upload = new ServletFileUpload(factory);
        upload.setSizeMax(maxFileSize);

        List<FileItem> fileItems = upload.parseRequest(request);
        Iterator<FileItem> iterator = fileItems.iterator();

        LOG.log(Level.INFO, "file size --> {0}", fileItems.size());
        while (iterator.hasNext()) {
            FileItem item = iterator.next();
            //if (!item.isFormField()) {
            LOG.log(Level.INFO, "content type --> {0}", item.getContentType());
            LOG.log(Level.INFO, "name --> {0}", item.getName());
            LOG.log(Level.INFO, "field name --> {0}", item.getFieldName());
            LOG.log(Level.INFO, "string --> {0}", item.getString());

            item.write(new File("c:\\temp", UUID.randomUUID().toString() + ".png"));
            //}
        }
    } catch (FileUploadException ex) {
        LOG.log(Level.WARNING, ex.getMessage());
    } catch (Exception ex) {
        LOG.log(Level.WARNING, ex.getMessage());
    }
}

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

public static int launch(MsOfficeType type, String url, AuthenticationInfo authInfo)
        throws IOException, InterruptedException, OfficeNotFoundException {
    OfficeFinder finder = FinderFactory.getFinder(type);
    logger.log(Level.INFO, "Are we using Office 2007 : {0}", finder.isMicrosoftOffice());
    logger.log(Level.INFO, "We are on {0} OS", OsEnum.getOS());
    boolean modeDisconnected = (OsEnum.isWindows() || OsEnum.getOS() == OsEnum.MAC_OSX)
            && finder.isMicrosoftOffice();
    switch (type) {
    case EXCEL:/*from  w  w  w  .ja  v a  2 s. com*/
        return launch(finder.findSpreadsheet(), url, modeDisconnected, authInfo);
    case POWERPOINT:
        return launch(finder.findPresentation(), url, modeDisconnected, authInfo);
    case WORD:
        return launch(finder.findWordEditor(), url, modeDisconnected, authInfo);
    case NONE:
    default:
        return launch(finder.findOther(), url, modeDisconnected, authInfo);
    }
}

From source file:com.leqcar.interfaces.command.ValetCommandController.java

@RequestMapping(method = RequestMethod.POST)
public ResponseEntity<ValetResponse> requestValet(@RequestBody VehicleInfoResource vehicleInfoResource) {
    LOG.log(Level.INFO, "-- requesting valet service ---");

    Validate.notNull(vehicleInfoResource, "Vehicle should not be null");
    Validate.notNull(vehicleInfoResource.getDriverInfo(), "Vehicle should have a Driver");

    ValetResponse response = valetCommandService.requestValet(new Vehicle(vehicleInfoResource.getPlateNumber(),
            toDriverModel(vehicleInfoResource.getDriverInfo())));
    URI location = ServletUriComponentsBuilder.fromCurrentRequest().path("/{id}")
            .buildAndExpand(response.getValetId()).toUri();

    response.add(linkTo(ValetCommandController.class).slash(response.getValetId()).withSelfRel());
    response.add(linkTo(methodOn(ValetCommandController.class).cancelValetRequest(response.getValetId()))
            .withRel("cancel"));
    /*response.add(linkTo(methodOn(ValetCommandController.class)
    .acceptValetRequest(response.getValetId(), new ValetAttendantInfo()))
    .withRel("accept"));*//*ww  w.ja v a  2s. c  o  m*/

    return ResponseEntity.created(location).body(response);

}

From source file:net.chrissearle.flickrvote.service.DaoPeriodicService.java

@Override
public void clearOldVotes() {
    if (logger.isLoggable(Level.INFO)) {
        logger.info("Clearing old votes");
    }/* www . ja  v a2s . c  om*/

    photographyDao.clearVotes();
}

From source file:net.sf.maltcms.chromaui.charts.tools.ChartTools.java

/**
 *
 * @param plot//from  w  w w.  j a v  a  2s.  com
 * @param screenPoint
 * @param screenDataArea
 * @return
 */
public static Point translatePointToImageCoord(XYPlot plot, final Point screenPoint,
        final Rectangle2D screenDataArea) {
    final ValueAxis da = plot.getDomainAxis();
    final ValueAxis ra = plot.getRangeAxis();

    final double x = da.java2DToValue(screenPoint.getX(), screenDataArea, plot.getDomainAxisEdge());
    final double y = ra.java2DToValue(screenPoint.getY(), screenDataArea, plot.getRangeAxisEdge());

    Logger.getLogger(ChartTools.class.getName()).log(Level.INFO, "{0} - {1}", new Object[] { x, y });

    if (x > 0 && y > 0) {
        return new Point((int) x, (int) y);
    }

    //        final double axisXperc = (x - plot.getDomainAxis().getLowerBound())
    //                / (plot.getDomainAxis().getUpperBound() - plot.getDomainAxis().getLowerBound());
    //        final double axisYperc = (y - plot.getRangeAxis().getLowerBound())
    //                / (plot.getRangeAxis().getUpperBound() - plot.getRangeAxis().getLowerBound());
    //
    //        System.out.println(axisXperc + " - " + axisYperc);
    //        final int newX = (int) (axisXperc * this.imageWidth);
    //        final int newY = (int) (axisYperc * this.imageHeight);
    return null;
}

From source file:net.paulgray.bbrest.security.CourseFilter.java

public void doFilter(ServletRequest request, ServletResponse response, FilterChain fc)
        throws IOException, ServletException {

    Logger.getLogger(CourseFilter.class.getName()).log(Level.INFO, "Calling Course Filter...");

    String url = ((HttpServletRequest) request).getRequestURL().toString();
    String course = getCourseIdFromUrl(url);

    Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
    User user = (User) authentication.getDetails();

    Id userId = BlackboardUtilities.getIdFromPk(user.getId(), blackboard.data.user.User.class);
    Id courseId = BlackboardUtilities.getIdFromPk(course, blackboard.data.course.Course.class);

    if (!SecurityUtil.userHasEntitlement(userId, courseId, new Entitlement("course.VIEW"))) {
        throw new AccessDeniedException(
                "Context user: '" + user.getUsername() + "' does not have access to view course: " + courseId);
    }/*  w ww . j  av  a2 s .  c o  m*/

}

From source file:eu.flatworld.worldexplorer.layer.bmng.BMNGHTTPProvider.java

public BMNGHTTPProvider() {
    LogX.log(Level.INFO, NAME + " starting");
    client = new HttpClient();
    Thread queueRunner = new Thread(this, this.getClass().getName() + "_queueRunner");
    queueRunner.setDaemon(true);//from  w  w  w.  j a  v a 2  s . c om
    queueRunner.start();
}

From source file:edu.eci.arsw.controllers.ProductsController.java

@RequestMapping(method = RequestMethod.POST)
public ResponseEntity<?> addProduct(@RequestBody Producto p) {
    services.addNewProduct(p);/*w w w  .ja v  a2  s .  c  o m*/
    Logger.getLogger(ProductsController.class.getName()).log(Level.INFO, null, "POST request processed" + p);
    return new ResponseEntity<>(HttpStatus.ACCEPTED);
}

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

public void tweet(String message) {
    if (logger.isLoggable(Level.INFO)) {
        logger.info(new StringBuilder().append("Tweet: ").append(message).toString());
    }/*from w  w  w  .j a  v a 2 s .c om*/

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