Example usage for java.util.logging Level FINER

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

Introduction

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

Prototype

Level FINER

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

Click Source Link

Document

FINER indicates a fairly detailed tracing message.

Usage

From source file:mendeley2kindle.KindleDAO.java

public void createKCollection(String collection) throws JSONException {
    String key = collection + KINDLE_LOCALE;
    log.log(Level.FINER, "Creating kindle collection: " + key);
    if (!collections.isNull(key)) {
        log.log(Level.FINE, "Collection already exists: " + key);
        return;//w ww.  j  av a 2s.  c  o m
    }
    JSONObject data = new JSONObject();
    data.put("items", new JSONArray());
    data.put("lastAccess", System.currentTimeMillis());
    collections.put(key, data);
    log.log(Level.FINER, "Created kindle collection: " + key);
}

From source file:com.bdb.weather.display.windrose.WindRosePlot.java

/**
 * Load the wind rose data into the dataset.
 * /*from www  .  j  a v a2s.c om*/
 * @param d The wind rose data
 */
public void setDataset(WindRoseData d) {
    data = d;
    if (d == null) {
        setDataset((XYSeriesCollection) null);
        return;
    }

    int numSlices = d.getNumSlices();
    double arcLength = (360.0 / numSlices) / 2.0;
    double halfArcLength = arcLength / 2.0;

    XYSeriesCollection dataset = new XYSeriesCollection();

    logger.log(Level.FINEST, "Creating Wind Rose dataset with {0} slices. arcLength = {1}",
            new Object[] { numSlices, arcLength });

    //
    // First go through the wind direction slices. Each weather station can have a different number of
    // direction slices. The minimum is probably 4 and the maximum is probably 360.
    //
    int seriesNumber = 0;
    for (int i = 0; i < numSlices; i++) {
        WindSlice slice = d.getSlice(i);

        //
        // The length of the pie slice is determined by the percentage of the wind that was blowing within
        // the slice. Calm winds entries are ignored.
        //
        double percent = slice.getPercentageOfWind();

        double lastLength = 0.0;

        logger.log(Level.FINER, "Slice {0} has {1} speed bins", new Object[] { i, slice.getNumSpeedBins() });

        //
        // Each slice is then divided by speed bins. Each bin is represented by a color and the length
        // of each slice segment is determined by the percentage of time the wind was blowing within the
        // speed bin.
        //
        for (int j = 0; j < slice.getNumSpeedBins(); j++) {
            Heading heading = Heading.headingForSlice(i, numSlices);
            XYSeries series = new XYSeries(heading.toString() + j, false);

            double headingValue = heading.get();
            double binPercentage = slice.speedBinPercentage(j);

            double length = lastLength;

            if (binPercentage != 0.0)
                length += percent * (binPercentage / 100.0);

            double left = headingValue - halfArcLength;
            double right = headingValue + halfArcLength;

            logger.log(Level.FINEST, "Adding series with data: {0},{1},{2}:{3}",
                    new Object[] { left, right, length, slice.speedBinPercentage(j) });

            //
            // Each slices speed segment is drawn as a separate series with its own color
            //
            series.add(left, lastLength);
            series.add(right, lastLength);

            series.add(right, length);
            series.add(left, length);

            dataset.addSeries(series);

            renderer.setSeriesPaint(seriesNumber, binColor[j]);
            renderer.setSeriesFilled(seriesNumber++, true);

            lastLength = length;
        }

    }

    setDataset(dataset);
}

From source file:org.archive.modules.recrawl.BdbContentDigestHistory.java

public void load(CrawlURI curi) {
    // make this call in all cases so that the value is initialized and
    // WARCWriterProcessor knows it should put the info in there
    HashMap<String, Object> contentDigestHistory = curi.getContentDigestHistory();

    @SuppressWarnings("unchecked")
    Map<String, Object> loadedHistory = store.get(persistKeyFor(curi));
    if (loadedHistory != null) {
        if (logger.isLoggable(Level.FINER)) {
            logger.finer("loaded history by digest " + persistKeyFor(curi) + " for uri " + curi + " - "
                    + loadedHistory);// w ww . ja  va 2s  .c om
        }
        contentDigestHistory.putAll(loadedHistory);
    }
}

From source file:io.stallion.services.Log.java

public static void finer(String message, Object... args) {
    if (getLogLevel().intValue() > Level.FINER.intValue()) {
        return;/*  ww  w .j  a  v a  2s  .  c o m*/
    }

    //System.out.println(message);

    Throwable t = new Throwable();
    t.getStackTrace()[2].toString();
    String clz = t.getStackTrace()[2].getClassName().replace("io.stallion.", "");
    String method = t.getStackTrace()[2].getMethodName();
    logger.logp(Level.FINER, clz, method, message, args);

}

From source file:org.b3log.solo.util.Skins.java

/**
 * Loads skins for the specified preference and initializes templates 
 * loading./*from   www.j av  a  2 s. co  m*/
 * 
 * <p>
 * If the skins directory has been changed, persists the change into 
 * preference.
 * </p>
 *
 * @param preference the specified preference
 * @throws Exception exception
 */
public static void loadSkins(final JSONObject preference) throws Exception {
    Stopwatchs.start("Load Skins");

    LOGGER.info("Loading skins....");

    final Set<String> skinDirNames = getSkinDirNames();
    LOGGER.log(Level.FINER, "Loaded skins[dirNames={0}]", skinDirNames);
    final JSONArray skinArray = new JSONArray();
    for (final String dirName : skinDirNames) {
        final JSONObject skin = new JSONObject();
        final String name = getSkinName(dirName);
        if (null == name) {
            LOGGER.log(Level.WARNING, "The directory[{0}] does not contain any skin, ignored it", dirName);
            continue;
        }

        skin.put(SKIN_NAME, name);
        skin.put(SKIN_DIR_NAME, dirName);

        skinArray.put(skin);
    }

    final String currentSkinDirName = preference.optString(SKIN_DIR_NAME);
    final String skinName = preference.optString(SKIN_NAME);
    LOGGER.log(Level.INFO, "Current skin[name={0}]", skinName);

    if (!skinDirNames.contains(currentSkinDirName)) {
        LOGGER.log(Level.WARNING,
                "Configred skin[dirName={0}] can not find, try to use " + "default skin[dirName=ease] instead.",
                currentSkinDirName);
        if (!skinDirNames.contains("ease")) {
            LOGGER.log(Level.SEVERE, "Can not find skin[dirName=ease]");

            throw new IllegalStateException(
                    "Can not find default skin[dirName=ease], please redeploy your B3log Solo and make sure "
                            + "contains this default skin!");
        }

        preference.put(SKIN_DIR_NAME, "ease");
        preference.put(SKIN_NAME, "ease");

        PreferenceMgmtService.getInstance().updatePreference(preference);
        PageCaches.removeAll(); // Clears cache manually.
    }

    final String skinsString = skinArray.toString();
    if (!skinsString.equals(preference.getString(SKINS))) {
        LOGGER.log(Level.INFO,
                "The skins directory has been changed, persists " + "the change into preference");
        preference.put(SKINS, skinsString);
        PreferenceMgmtService.getInstance().updatePreference(preference);
        PageCaches.removeAll(); // Clears cache manually.
    }

    if (preference.getBoolean(Preference.PAGE_CACHE_ENABLED)) {
        Latkes.enablePageCache();
    } else {
        Latkes.disablePageCache();
    }

    setDirectoryForTemplateLoading(preference.getString(SKIN_DIR_NAME));

    final String localeString = preference.getString(Preference.LOCALE_STRING);
    if ("zh_CN".equals(localeString)) {
        TimeZones.setTimeZone("Asia/Shanghai");
    }

    LOGGER.info("Loaded skins....");

    Stopwatchs.end();
}

From source file:com.ibm.jaggr.service.util.BundleVersionsHashBase.java

/**
 * Returns an MD5 hash of the concatenated bundle header values from each of the specified bundles.
 * If any of the specified bundles are not found, a {@link NotFoundException} is thrown.
 *
 * @param headerNames the bundle header values to include in the hash
 * @param bundleNames the bundle names to include in the hash
 *
 * @return the computed hash//  ww w  .j  a  v a 2  s  . c o m
 * @throws NotFoundException
 */
public String generateHash(String[] headerNames, String[] bundleNames) throws NotFoundException {
    final String sourceMethod = "generateCacheBustHash"; //$NON-NLS-1$
    final boolean isTraceLogging = log.isLoggable(Level.FINER);
    if (isTraceLogging) {
        log.entering(BundleVersionsHashBase.class.getName(), sourceMethod);
    }

    // Sort the input lists so result is independent of the order the names are specified
    List<String> sortedHeaderNames = Arrays.asList(headerNames);
    List<String> sortedBundleNames = Arrays.asList(bundleNames);
    Collections.sort(sortedHeaderNames);
    Collections.sort(sortedBundleNames);

    StringBuffer sb = new StringBuffer();
    for (String bundleName : sortedBundleNames) {
        Dictionary<?, ?> bundleHeaders = getBundleHeaders(bundleName);
        for (String headerName : sortedHeaderNames) {
            Object value = bundleHeaders.get(headerName);
            if (isTraceLogging) {
                log.finer("Bundle = " + bundleName + ", Header name = " + headerName + ", Header value = " //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$
                        + value);
            }
            sb.append(sb.length() == 0 ? "" : ",").append(value); //$NON-NLS-1$ //$NON-NLS-2$
        }
    }

    String result = null;
    if (sb.length() > 0) {
        MessageDigest md = null;
        try {
            md = MessageDigest.getInstance("MD5"); //$NON-NLS-1$
            result = Base64.encodeBase64URLSafeString(md.digest(sb.toString().getBytes("UTF-8"))); //$NON-NLS-1$
        } catch (Exception e) {
            if (log.isLoggable(Level.SEVERE)) {
                log.log(Level.SEVERE, e.getMessage(), e);
            }
            throw new RuntimeException(e);
        }
    }
    if (isTraceLogging) {
        log.exiting(BundleVersionsHashBase.class.getName(), sourceMethod, result);
        ;
    }
    return result;
}

From source file:com.getblimp.api.client.Blimp.java

public Blimp(String userName, String apiKey, String applicationId, String applicationSecret) {
    super();//w  w w.  j a  v a  2 s  . c  om
    this.userName = userName;
    this.apiKey = apiKey;
    this.applicationId = applicationId;
    this.applicationSecret = applicationSecret;
    this.resourceBundle = ResourceBundle.getBundle("blimp-constants");
    this.baseUrl = resourceBundle.getString("base_url");
    Blimp.logger.setLevel(Level.FINER);

}

From source file:com.ibm.jaggr.core.util.ZipUtil.java

/**
 * Extracts the file entry to the location specified by {@code file}
 *
 * @param entry//  ww w.jav  a  2  s.c o m
 *            the {@link ZipEntry} object for the directory being extracted
 * @param zipIn
 *            the zip input stream to read from
 * @param file
 *            the {@link File} object for the target file
 * @throws IOException
 */
private static void extractFile(ZipEntry entry, ZipInputStream zipIn, File file) throws IOException {
    final String sourceMethod = "extractFile"; //$NON-NLS-1$
    final boolean isTraceLogging = log.isLoggable(Level.FINER);
    if (isTraceLogging) {
        log.entering(sourceClass, sourceMethod, new Object[] { entry, zipIn, file });
    }

    Files.createParentDirs(file);
    BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(file));
    try {
        IOUtils.copy(zipIn, bos);
    } finally {
        bos.close();
    }
    if (!file.setLastModified(entry.getTime())) {
        throw new IOException("Failed to set last modified time for " + file.getAbsolutePath()); //$NON-NLS-1$
    }

    if (isTraceLogging) {
        log.exiting(sourceClass, sourceMethod);
    }
}

From source file:com.ibm.jaggr.core.impl.modulebuilder.less.LessModuleBuilder.java

@Override
public Scriptable createThreadScope(Context cx, Scriptable protoScope) {
    final String sourceMethod = "createThreadScope"; //$NON-NLS-1$
    final boolean isTraceLogging = log.isLoggable(Level.FINER);
    if (isTraceLogging) {
        log.entering(sourceClass, sourceMethod, new Object[] { cx, protoScope });
    }//from  www .  j ava2s  .com
    Scriptable threadScope = super.createThreadScope(cx, protoScope);
    lessJsScript.exec(cx, threadScope);
    compilerScript.exec(cx, threadScope);

    if (isTraceLogging) {
        log.exiting(sourceMethod, sourceMethod, threadScope);
    }
    return threadScope;
}

From source file:com.cloudbees.plugins.deployer.sources.WildcardPathDeploySource.java

/**
 * {@inheritDoc}//  w  w  w. j a v a  2 s .  co  m
 */
@Override
@CheckForNull
public FilePath getApplicationFile(@NonNull FilePath workspace) {
    try {
        FilePath[] list = workspace.list(getFilePattern());
        return list != null && list.length > 0 ? list[0] : null;
    } catch (IOException e) {
        LOGGER.log(Level.FINE,
                Messages.WildcardPathDeploySource_CouldNotListFromWorkspace(getFilePattern(), workspace), e);
    } catch (InterruptedException e) {
        LOGGER.log(Level.FINER,
                Messages.WildcardPathDeploySource_CouldNotListFromWorkspace(getFilePattern(), workspace), e);
    }
    return null;
}