Example usage for java.util.logging Level FINEST

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

Introduction

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

Prototype

Level FINEST

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

Click Source Link

Document

FINEST indicates a highly detailed tracing message.

Usage

From source file:magma.agent.worldmodel.impl.VisibleObject.java

/**
 * Updates this object with the latest perception
 * @param vision new perception of movable object
 * @param time the current absolute time
 * @param thisPlayer the position of the viewing agent in the global
 *        coordinate system//from  www  . ja v a2  s  .  c o  m
 */
public void update(IVisibleObjectPerceptor vision, float time, IThisPlayer thisPlayer) {
    preUpdate(vision);

    // calculate global coordinate of object
    // rotation (we assume that the agent can only change view angle in z-axis
    Vector3D localPos = vision.getPosition();

    previousPosition = getPosition();

    // Rotation around y axis with angle c:
    // to compensate neck angle
    // TODO: add player vertical angle once we know
    Angle horizontalAngle = thisPlayer.getHorizontalAngle();
    Angle verticalAngle = Angle.rad(0);
    double neckPitchAngle = thisPlayer.getNeckPitchAngle();
    double neckYawAngle = thisPlayer.getNeckYawAngle();

    Vector3D global = getGlobalFromLocalPosition(localPos, thisPlayer.getPosition(), horizontalAngle,
            verticalAngle, neckPitchAngle, neckYawAngle);

    position = global;

    logger.log(Level.FINEST, "position of: {0} ({1}, {2}, {3})",
            new Object[] { vision.getName(), position.getX(), position.getY(), position.getZ() });

    visible = true;
    lastSeenTime = time;
}

From source file:com.clothcat.hpoolauto.model.Model.java

/**
 * Process a receive transaction/*from www .java 2  s .c  om*/
 */
private void processReceipt(JSONObject j) {
    HLogger.log(Level.FINEST, "Processing receipt\n" + j.toString());
    try {
        if (isNewTransaction(j)) {
            HLogger.log("new transaction! " + j.getString("txid"));

            // get the transaction for this receipt
            String txid = j.getString("txid");
            String s = rpcWorker.getTransaction(txid);
            HLogger.log(Level.FINEST, "Got transaction: " + s);

            JSONTokener jt = new JSONTokener(s);
            JSONObject tx = new JSONObjectDuplicates(jt);
            JSONArray vout = tx.getJSONArray("vout");
            HLogger.log(Level.FINEST, "Extracted vout array: \n" + vout.toString());

            String sendingAddress = vout.getJSONObject(0).getJSONObject("scriptPubKey")
                    .getJSONArray("addresses").getString(0);
            HLogger.log(Level.FINEST, "Extracted sending address: " + sendingAddress);
            // see if the sending address belongs to us
            if (rpcWorker.isOurAddress(sendingAddress)) {
                HLogger.log(Level.FINEST, "sending address belongs to us, ignoring " + "transaction");
            } else {
                String receivingAddress = vout.getJSONObject(1).getJSONObject("scriptPubKey")
                        .getJSONArray("addresses").getString(0);
                HLogger.log(Level.FINEST, "Extracted receiving address: " + receivingAddress);
                String amountStr = vout.getJSONObject(1).getString("value");
                HLogger.log(Level.FINEST, "Extracted amount: " + amountStr);
                double d = Double.valueOf(amountStr);
                d *= Constants.uH_IN_HYP;
                long amount = (long) d;
                HLogger.log(Level.FINEST, "Amount in uHyp is: " + d);

                Pool p = getPool(getCurrPoolName());
                long minSpace = getMinFill() - p.calculateFillAmount();
                long maxSpace = getMaxFill() - p.calculateFillAmount();
                HLogger.log(Level.FINEST, "minSpace: " + minSpace + "; maxSpace: " + maxSpace);

                if (amount < minSpace) {
                    // investment fits in pool but does not fill it
                    HLogger.log(Level.FINE, "amount < minSpace");
                    Investment inv = new Investment();
                    inv.setAmount(amount);
                    inv.setDatestamp(new java.util.Date().getTime() / 1000);
                    inv.setFromAddress(sendingAddress);
                    p.getInvestments().add(inv);
                    HLogger.log(Level.FINE, "added investment to pool: \n" + inv.toJson());
                } else if (amount < maxSpace) {
                    // investment fits in pool and fills it
                    HLogger.log(Level.FINE, "amount < maxSpace");
                    Investment inv = new Investment();
                    inv.setAmount(amount);
                    inv.setDatestamp(new java.util.Date().getTime() / 1000);
                    inv.setFromAddress(sendingAddress);
                    p.getInvestments().add(inv);
                    HLogger.log(Level.FINE, "added investment to pool: \n" + inv.toJson());
                    HLogger.log(Level.FINE, "Moving to next pool");
                    moveToNextPool();
                } else {
                    HLogger.log(Level.FINE, "amount > minSpace");
                    // investment overflows pool, so fill it and then rollover
                    // what's left as the first investment in the next pool.

                    // we want to take a random amount of investment that
                    // lets the pool size be between min and max, but which 
                    // still leaves the investor enough for the minimum 
                    // investment for the next pool.
                    long maxInvAmount = minOf(amount - getMinInvestment(), 1000);
                    HLogger.log(Level.FINE, "maxInvAmount: " + maxInvAmount);
                    long minInvAmount = minSpace;
                    HLogger.log(Level.FINE, "minInvAmount: " + minInvAmount);

                    long randomAmount = getRandomLongInRange(minInvAmount, maxInvAmount);
                    HLogger.log(Level.FINE, "randomAmount: " + randomAmount);
                    long remainingAmount = amount - randomAmount;
                    HLogger.log(Level.FINE, "remainingAmount: " + remainingAmount);

                    Investment inv = new Investment();
                    inv.setAmount(randomAmount);
                    inv.setDatestamp(new java.util.Date().getTime() / 1000);
                    inv.setFromAddress(sendingAddress);
                    p.getInvestments().add(inv);
                    HLogger.log(Level.FINE, "added investment to pool: \n" + inv.toJson());
                    HLogger.log(Level.FINE, "moving to next pool with remaining amount");
                    moveToNextPool();

                    Pool p2 = getPool(getCurrPoolName());
                    Investment inv2 = new Investment();
                    inv2.setAmount(remainingAmount);
                    inv2.setDatestamp(new java.util.Date().getTime() / 1000);
                    inv2.setFromAddress(sendingAddress);
                    p2.getInvestments().add(inv2);
                    HLogger.log(Level.FINE,
                            "added investment to new pool: " + p2.getPoolName() + "\n" + inv.toJson());
                }
            }
            HLogger.log(Level.FINE, "Marking txid as done: " + txid);
            setTransactionDone(txid);
        }
    } catch (JSONException ex) {
        HLogger.log(Level.SEVERE, "Caught exception in processReceipt()", ex);
        Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
    }
}

From source file:com.ibm.team.build.internal.hjplugin.util.Helper.java

public static String getStringBuildParameter(Run<?, ?> build, String property, TaskListener listener)
        throws IOException, InterruptedException {
    LOGGER.finest("Helper.getStringBuildProperty : Begin"); //$NON-NLS-1$
    if (LOGGER.isLoggable(Level.FINEST)) {
        LOGGER.finest("Helper.getStringBuildProperty: Finding value for property '" + property //$NON-NLS-1$
                + "' in the build environment variables."); //$NON-NLS-1$
    }//  ww  w  . jav a2s. c o m
    String value = Util.fixEmptyAndTrim(build.getEnvironment(listener).get(property));
    if (value == null) {
        if (LOGGER.isLoggable(Level.FINEST)) {
            LOGGER.finest("Helper.getStringBuildProperty: Cannot find value for property '" + property //$NON-NLS-1$
                    + "' in the build environment variables. Looking in the build parameters."); //$NON-NLS-1$
        }
        // check if parameter is available from ParametersAction
        value = getValueFromParametersAction(build, property);
        if (value == null) {
            if (LOGGER.isLoggable(Level.FINEST)) {
                LOGGER.finest("Helper.getStringBuildProperty: Cannot find value for property '" + property //$NON-NLS-1$
                        + "' in the build parameters."); //$NON-NLS-1$
            }
        }
    }
    if (LOGGER.isLoggable(Level.FINEST)) {
        LOGGER.finest(
                "Helper.getStringBuildProperty: Value for property '" + property + "' is '" + value + "'."); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
    }
    return value;
}

From source file:fr.ortolang.diffusion.store.binary.BinaryStoreServiceBean.java

@PostConstruct
public void init() {
    this.base = Paths.get(OrtolangConfig.getInstance().getHomePath().toString(), DEFAULT_BINARY_HOME);
    this.working = Paths.get(base.toString(), WORK);
    this.collide = Paths.get(base.toString(), COLLIDE);
    this.factory = new SHA1FilterInputStreamFactory();
    LOGGER.log(Level.FINEST, "Initializing service with base folder: " + base);
    try {//from   w  w  w .  ja  va 2  s.com
        Files.createDirectories(base);
        Files.createDirectories(working);
        Files.createDirectories(collide);
    } catch (Exception e) {
        LOGGER.log(Level.SEVERE, "unable to initialize binary store", e);
    }
    this.handler = new DefaultHandler();
    this.autoDetectParser = new AutoDetectParser();
}

From source file:com.microsoft.azure.util.TokenCache.java

private AccessToken readTokenFile() {
    LOGGER.log(Level.FINEST, "TokenCache: readTokenFile: Read token from file {0}", path);
    FileInputStream is = null;//from  w w w .  j  a v  a2s.  co m
    ObjectInputStream objectIS = null;

    try {
        final File fileCache = new File(path);
        if (fileCache.exists()) {
            is = new FileInputStream(fileCache);
            objectIS = new ObjectInputStream(is);
            return AccessToken.class.cast(objectIS.readObject());
        } else {
            LOGGER.log(Level.FINEST, "TokenCache: readTokenFile: File {0} does not exist", path);
        }
    } catch (FileNotFoundException e) {
        LOGGER.log(Level.SEVERE, "TokenCache: readTokenFile: Cache file not found", e);
    } catch (IOException e) {
        LOGGER.log(Level.SEVERE, "TokenCache: readTokenFile: Error reading serialized object", e);
    } catch (ClassNotFoundException e) {
        LOGGER.log(Level.SEVERE, "TokenCache: readTokenFile: Error deserializing object", e);
    } finally {
        IOUtils.closeQuietly(is);
        IOUtils.closeQuietly(objectIS);
    }

    return null;
}

From source file:ca.inverse.sogo.security.SOGoOfficer.java

/**
 * //from  w w  w .  ja v  a  2  s  .com
 */
private SOGoUser authenticateBasicCredential(Cred credential) {

    String username, password;

    Authentication auth = credential.getAuthentication();
    String deviceId = auth.getDeviceId();
    String credentials = auth.getData();
    String userpwd = new String(Base64.decode(auth.getData()));
    SOGoUser user = new SOGoUser();

    int p = userpwd.indexOf(':');

    if (p == -1) {
        username = userpwd;
        password = "";
    } else {
        username = (p > 0) ? userpwd.substring(0, p) : "";
        password = (p == (userpwd.length() - 1)) ? "" : userpwd.substring(p + 1);
    }

    if (_log.isLoggable(Level.FINEST)) {
        _log.finest("Username: " + username);
        _log.finest("Credentials: " + credentials);
    }

    if (!checkSOGoCredentials(this.getHost(), username, credentials, user)) {
        return null;
    }

    try {
        if (existsUser(username)) {
            if (_log.isLoggable(Level.INFO)) {
                _log.info("User with '" + username + "' exists.");
            }
        } else {
            insertUser(username, " ");
            if (_log.isLoggable(Level.INFO)) {
                _log.info("User '" + username + "' created.");
            }
        }
    } catch (PersistentStoreException e) {
        if (_log.isLoggable(Level.SEVERE)) {
            _log.severe("Error inserting a new user: " + e.getMessage());
        }
        if (_log.isLoggable(Level.INFO)) {
            _log.log(Level.INFO, "authenticateBasicCredential", e);
        }
        return null;
    }

    try {
        if (!existsPrincipal(username, deviceId)) {
            credential.getAuthentication().setPrincipalId(insertPrincipal(username, deviceId));
        }
    } catch (PersistentStoreException e) {
        if (_log.isLoggable(Level.SEVERE)) {
            _log.severe("Error inserting a new principal: " + e.getMessage());
        }
        if (_log.isLoggable(Level.INFO)) {
            _log.log(Level.INFO, "authenticateBasicCredential", e);
        }
        return null;
    }

    user.setUsername(username);
    user.setPassword(password);
    return user;
}

From source file:com.softenido.cafedark.io.CachedFile.java

private void visit(VirtualFile file, InputStream in, final int level) {
    if (level > options.recursive) {
        return;//from   w  w  w.  ja  v  a  2 s.  co  m
    }
    logger.log(Level.FINEST, "file={0}", file);
    try {
        if (!canVisit(file, level)) {
            return;
        }
        if (canDo(file)) {
            doForEach(file);
        }
        if (!file.canRead()) {
            return;
        }
        if (!file.isComplex() && file.isDirectory()) {
            followDirectory(file.getBaseFile(), level);
        } else if (canFollowArchive(file.getName())) {
            followArchive(file, in, level + 1);
        }
    } catch (Exception ex) {
        doException(file.toString(), ex);
    }
}

From source file:SuperPeer.java

@Override
public synchronized HasherInterface getHasher() throws Exception {
    lg.log(Level.FINEST, "getHasher Entry.");
    lg.log(Level.FINEST, "getHasher Exit.");
    return new SHA1Hasher(mbits);
}

From source file:com.speed.ob.Obfuscator.java

private static Level parseLevel(String lvl) {
    if (lvl.equalsIgnoreCase("info")) {
        return Level.INFO;
    } else if (lvl.equalsIgnoreCase("warning")) {
        return Level.WARNING;
    } else if (lvl.equalsIgnoreCase("fine")) {
        return Level.FINE;
    } else if (lvl.equalsIgnoreCase("finer")) {
        return Level.FINER;
    } else if (lvl.equalsIgnoreCase("finest")) {
        return Level.FINEST;
    } else if (lvl.equalsIgnoreCase("all")) {
        return Level.ALL;
    } else if (lvl.equalsIgnoreCase("severe")) {
        return Level.SEVERE;
    } else if (lvl.equalsIgnoreCase("config")) {
        return Level.CONFIG;
    }/*ww w.ja va  2 s .co  m*/
    return Level.INFO;
}

From source file:com.cyberway.issue.crawler.postprocessor.LinksScoper.java

protected void innerProcess(final CrawlURI curi) {
    if (LOGGER.isLoggable(Level.FINEST)) {
        LOGGER.finest(getName() + " processing " + curi);
    }/*  w  w w .  j a v a2 s.com*/

    // If prerequisites, nothing to be done in here.
    if (curi.hasPrerequisiteUri()) {
        handlePrerequisite(curi);
        return;
    }

    // Don't extract links of error pages.
    if (curi.getFetchStatus() < 200 || curi.getFetchStatus() >= 400) {
        curi.clearOutlinks();
        return;
    }

    if (curi.outlinksSize() <= 0) {
        // No outlinks to process.
        return;
    }

    final boolean redirectsNewSeeds = ((Boolean) getUncheckedAttribute(curi, ATTR_SEED_REDIRECTS_NEW_SEEDS))
            .booleanValue();
    int preferenceDepthHops = ((Integer) getUncheckedAttribute(curi, ATTR_PREFERENCE_DEPTH_HOPS)).intValue();
    Collection<CandidateURI> inScopeLinks = new HashSet<CandidateURI>();
    for (final Iterator i = curi.getOutObjects().iterator(); i.hasNext();) {
        Object o = i.next();
        if (o instanceof Link) {
            final Link wref = (Link) o;
            try {
                final int directive = getSchedulingFor(curi, wref, preferenceDepthHops);
                final CandidateURI caURI = curi.createCandidateURI(curi.getBaseURI(), wref, directive,
                        considerAsSeed(curi, wref, redirectsNewSeeds));
                if (isInScope(caURI)) {
                    inScopeLinks.add(caURI);
                }
            } catch (URIException e) {
                getController().logUriError(e, curi.getUURI(), wref.getDestination().toString());
            }
        } else if (o instanceof CandidateURI) {
            CandidateURI caURI = (CandidateURI) o;
            if (isInScope(caURI)) {
                inScopeLinks.add(caURI);
            }
        } else {
            LOGGER.severe("Unexpected type: " + o);
        }
    }
    // Replace current links collection w/ inscopeLinks.  May be
    // an empty collection.
    curi.replaceOutlinks(inScopeLinks);
}