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:com.tc.simple.apn.factories.PushByteFactory.java

@Override
public byte[] buildPushBytes(int id, Payload payload) {
    byte[] byteMe = null;
    ByteArrayOutputStream baos = null;
    DataOutputStream dos = null;/*from  w w  w  .  java  2s  .  co  m*/

    try {
        baos = new ByteArrayOutputStream();

        dos = new DataOutputStream(baos);

        int expiry = 0; // (int) ((System.currentTimeMillis () / 1000L) + 7200);

        char[] cars = payload.getToken().trim().toCharArray();

        byte[] tokenBytes = Hex.decodeHex(cars);

        //command
        dos.writeByte(1);

        //id
        dos.writeInt(id);

        //expiry
        dos.writeInt(expiry);

        //token length.
        dos.writeShort(tokenBytes.length);

        //token
        dos.write(tokenBytes);

        //payload length
        dos.writeShort(payload.getJson().length());

        logger.log(Level.FINE, payload.getJson());

        //payload.
        dos.write(payload.getJson().getBytes());

        byteMe = baos.toByteArray();

    } catch (Exception e) {
        logger.log(Level.SEVERE, null, e);

    } finally {
        CloseUtils.close(dos);
        CloseUtils.close(baos);
    }

    return byteMe;

}

From source file:net.chrissearle.flickrvote.flickr.impl.FlickrJCommentDAO.java

public void postComment(String imageId, String comment) {
    if (logger.isLoggable(Level.FINE)) {
        logger.fine("Posting comment check: " + commentsActiveFlag);
    }/* w  ww  . j a  v a2  s . c  o  m*/

    if (commentsActiveFlag) {
        if (logger.isLoggable(Level.INFO)) {
            logger.info("Image commented: " + imageId);

            if (logger.isLoggable(Level.FINE)) {
                logger.fine("Commenting on : " + imageId + " with comment: " + comment);
            }
        }

        comment(imageId, comment);
    }

}

From source file:com.joyfulmongo.db.javadriver.MongoCollection.java

public void update(JSONObject query, JSONObject updates) {
    JSONObject extraInstruction = null;// w ww.  ja v  a  2  s .co m

    List<String> modifiers = findModifiers(updates);
    for (String modifier : modifiers) {
        if (extraInstruction == null) {
            extraInstruction = new JSONObject();
        }
        if (LOGGER.isLoggable(Level.FINE)) {
            LOGGER.fine("UPDATE modifier=" + modifier + " " + extraInstruction);
        }
        Object o = updates.get(modifier);
        extraInstruction.put(modifier, o);
    }

    for (String modifier : modifiers) {
        updates.remove(modifier);
    }

    this.ensure2DIndexIfExist(updates);

    MongoObject queryObj = new MongoObject(colName, query);
    DBObject queryDBObject = queryObj.getDBObject();

    WriteResult result = null;
    {
        if (LOGGER.isLoggable(Level.FINE)) {
            LOGGER.fine("UPDATE =" + " " + updates);
        }
        JSONObject updateInstruction = new JSONObject();
        updateInstruction.put("$set", updates);
        MongoObject jfObj = new MongoObject(colName, updateInstruction);
        DBObject updateDBObject = jfObj.getDBObject();

        result = dbCollection.update(queryDBObject, updateDBObject, false, false, WriteConcern.SAFE);
    }

    if (extraInstruction != null) {
        MongoObject jfObj = new MongoObject(colName, extraInstruction);
        DBObject updateInstructionObject = jfObj.getDBObject();
        result = dbCollection.update(queryDBObject, updateInstructionObject, false, false, WriteConcern.SAFE);
    }

    recordWriteResult("update", result);
}

From source file:edu.usu.sdl.openstorefront.core.view.DateParam.java

public DateParam(String input) {
    SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.sss");
    try {/*from w  w  w . j a va 2 s. c  o  m*/
        date = sdf.parse(input);
    } catch (ParseException e) {
        sdf = new SimpleDateFormat("yyyy-MM-dd");
        try {
            date = sdf.parse(input);
        } catch (ParseException ex) {
            sdf = new SimpleDateFormat("MM/dd/yyyy");
            try {
                date = sdf.parse(input);
            } catch (ParseException exc) {
                if (StringUtils.isNumeric(input)) {
                    try {
                        date = new Date(Long.parseLong(input));
                    } catch (Exception exception) {
                        //Don't throw error here it's to low level. (it will get wrapped several times)
                        //if the date is not expected to be null handle error there.
                        log.log(Level.FINE, MessageFormat.format("Unsupport date format: {0}", input));
                    }
                } else {
                    log.log(Level.FINE, MessageFormat.format("Unsupport date format: {0}", input));
                }
            }
        }
    }
}

From source file:demo.service.CustomerService.java

@POST
@Consumes("application/json")
public Response updateCustomer(final Customer customer) {
    Validate.notNull(customer);//from  w  ww. ja  v a2  s . co  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.stratuscom.harvester.PropertiesFileReader.java

private void readPropertiesFile(FileObject fo) throws FileSystemException, IOException {
    String name = fo.getName().getBaseName();
    Properties props = getProperties(fo);
    context.put(name, props);//w w w. j  av a 2s . com
    log.log(Level.FINE, MessageNames.READ_PROPERTIES_FILE, name);
    if (log.isLoggable(Level.FINER)) {
        log.log(Level.FINER, MessageNames.READ_PROPERTIES, Utils.format(props));
    }
}

From source file:net.chrissearle.flickrvote.web.vote.VoteAction.java

public void setVotes(List<String> votes) {
    if (logger.isLoggable(Level.FINE)) {
        logger.fine("setVotes: " + votes);
    }/*  w ww  .  j  a  v a2  s. c om*/

    this.votes = votes;
}

From source file:magma.agent.believe.impl.BeamTime.java

@Override
public float getTruthValue() {
    String playmode = worldModel.getPlaymode();
    if (playmode.equalsIgnoreCase(IServerConfigFilesConstants.PLAYMODE_GOAL_RIGHT)
            || playmode.equalsIgnoreCase(IServerConfigFilesConstants.PLAYMODE_GOAL_LEFT)
            || playmode.equalsIgnoreCase(IServerConfigFilesConstants.PLAYMODE_BEFORE_KICK_OFF)) {
        Vector3D position = worldModel.getThisPlayer().getPosition();
        Vector3D homePosition = worldModel.getThisPlayer().getHomePosition(playmode);

        logger.log(Level.FINE, "position: ({0}, {1}) home position: ({2}, {3})",
                new Object[] { position.getX(), position.getY(), homePosition.getX(), homePosition.getY() });

        double distance = position.subtract(homePosition).getNorm();
        if (distance > 0.3) {
            return 1.0f;
        }// w  w  w.ja va2s .  c o m
    }
    return 0.0f;
}

From source file:edu.usu.sdl.openstorefront.security.SecurityUtil.java

/**
 * Checks the current user to see if they are an admin
 *
 * @return true if the user is an admin// w  w  w  .ja v a2  s.c  om
 */
public static boolean isAdminUser() {
    boolean admin = false;
    try {
        Subject currentUser = SecurityUtils.getSubject();
        admin = currentUser.hasRole(ADMIN_ROLE);
    } catch (Exception e) {
        log.log(Level.FINE, "Determining admin user.  No user is logged in.  This is likely an auto process.");
    }
    return admin;
}

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

/**
 * Performs injection by looking up the Spring ApplicationContext to find the single bean
 * which has the same type as or is a subclass of the Inject's type. 
 * @param dep the Dependency to be injected
 * @param target the object which is to have the member injected
 * @return true if a single matching bean existed in the context; false if no suitable 
 * bean was found//from  w w  w.j  a v a  2 s. c  o  m
 * @throws RuntimeException if more than one bean in the Spring ApplicationContext matched
 * the Dependency
 */
public ResolutionResult doResolve(Dependency dep, Object target) {
    Class<?> type = dep.getType();
    Map<?, ?> map = BeanFactoryUtils.beansOfTypeIncludingAncestors(applicationContext, type);
    if (map.size() < 1) {
        if (log.isLoggable(Level.FINE))
            log.fine("No beans of required type found for dependency " + dep + ". Skipping.");
    } else if (map.size() > 1) {
        throw new RuntimeException("Multiple beans of required type " + type + " found. Aborting.");
    } else {
        Object bean = map.values().iterator().next();
        if (log.isLoggable(Level.FINE))
            log.fine("Found bean [" + bean + "] to inject for dependency " + dep + ".");
        return ResolutionResult.resolved(bean);
    }
    return ResolutionResult.couldNotResolve();
}