Example usage for java.util.logging Level WARNING

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

Introduction

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

Prototype

Level WARNING

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

Click Source Link

Document

WARNING is a message level indicating a potential problem.

Usage

From source file:com.almende.eve.config.YamlReader.java

/**
 * Load.//from ww w.  ja  v a2 s.c  om
 * 
 * @param is
 *            the is
 * @return the config
 */
public static Config load(final InputStream is) {
    final ObjectMapper mapper = new ObjectMapper(new YAMLFactory());
    try {
        return Config.decorate((ObjectNode) mapper.readTree(is));
    } catch (final JsonProcessingException e) {
        LOG.log(Level.WARNING, "Couldn't parse Yaml file", e);
    } catch (final IOException e) {
        LOG.log(Level.WARNING, "Couldn't read Yaml file", e);
    }
    return null;
}

From source file:MyHtmlFormatter.java

public String format(LogRecord rec) {
    StringBuffer buf = new StringBuffer(1000);
    if (rec.getLevel().intValue() >= Level.WARNING.intValue()) {
        buf.append("<b>");
        buf.append(rec.getLevel());//  w  ww  .  j  a  va2  s  . c  o m
        buf.append("</b>");
    } else {
        buf.append(rec.getLevel());
    }
    buf.append(' ');
    buf.append(rec.getMillis());
    buf.append(' ');
    buf.append(formatMessage(rec));
    buf.append('\n');
    return buf.toString();
}

From source file:com.oic.connection.Connections.java

public synchronized static void removeConnection(WebSocketListener webSocketListener) {
    synchronized (userConnections) {
        try {/*  w  ww  .  ja  va 2 s.  co  m*/
            webSocketListener.getSession().close();
        } catch (IOException ex) {
            Logger.getLogger(Connections.class.getName()).log(Level.WARNING, null, ex);
        }
        userConnections.remove(webSocketListener);
    }
}

From source file:com.symbian.driver.core.controller.utils.ControllerUtils.java

/**
 * Returns the key file.//ww  w.  jav  a2  s.c  o m
 * 
 * @return The file location of the SIS file key.
 * @throws IOException If the key has an I/O problem.
 */
public static final File getKey() throws IOException {
    if (sKey == null) {
        String lKey = null;
        try {
            lKey = TDConfig.getInstance().getPreference(TDConfig.KEY);
        } catch (ParseException lParseException) {
            LOGGER.log(Level.WARNING, "Could not get the custom Key Location.", lParseException);
        }

        if (lKey != null && new File(lKey).isFile()) {
            sKey = new File(lKey);
            return sKey;
        }

        if ((sKey = JarUtils.extractResource(ControllerUtils.class, "/resource/testdriver.key")) == null) {
            throw new IOException("Could not extract Key.");
        }
        try {
            TDConfig.getInstance().setPreference(TDConfig.KEY, sKey.getAbsolutePath());
        } catch (ParseException e) {
            //  Auto-generated catch block
        }
    }

    return sKey;
}

From source file:jp.zippyzip.Pref.java

/**
 * JSON ???// w  ww .j  a va  2s .c  o  m
 * 
 * @param json JSON
 * @return 
 */
public static Pref fromJson(String json) {

    Pref ret = null;

    try {

        JSONObject jo = new JSONObject(json);

        ret = new Pref(jo.optString("code", ""), jo.optString("name", ""), jo.optString("yomi", ""));

    } catch (JSONException e) {
        log.log(Level.WARNING, "", e);
    }

    return ret;
}

From source file:de.dennishoersch.web.css.images.resolver.HttpPathResolver.java

private static Path downloadToTmp(String url) throws IOException {
    try {/*  w w w. ja v a  2  s .c o m*/
        URL weburl = new URL(url);
        byte[] bytes = IOUtils.toByteArray(weburl.openStream());

        Path tempFile = Files.createTempFile("__" + HttpPathResolver.class.getSimpleName() + "_", "");
        Files.write(tempFile, bytes);

        return tempFile;
    } catch (IllegalArgumentException e) {
        logger.log(Level.WARNING, "url of wrong format: '" + url + "'!", e);
        throw e;
    }
}

From source file:com.dagobert_engine.trading.service.DefaultStrategy.java

@Override
public Order createOrder() {
    logger.log(Level.WARNING, "No Strategy set. Please implement " + Strategy.class.getName()
            + ", annotate it with @Alternative and add your implementation to beans.xml as alternative.");
    return null;//from  w w  w .  ja  va2  s. c  om
}

From source file:edu.usu.sdl.openstorefront.core.util.TranslateUtil.java

public static <T extends LookupEntity> String translate(Class<T> lookupClass, String code) {
    String translated = code;// w  w  w. ja va2 s. c om
    if (StringUtils.isNotBlank(code)) {
        Service serviceProxy = ServiceProxyFactory.getServiceProxy();
        LookupEntity lookupEntity = serviceProxy.getLookupService().getLookupEnity(lookupClass, code);
        if (lookupEntity != null) {
            translated = lookupEntity.getDescription();
        } else {
            log.log(Level.WARNING, MessageFormat.format("Unable to find: {0} in lookup: {1}",
                    new Object[] { code, lookupClass.getName() }));
        }
    }
    return translated;
}

From source file:it_minds.dk.eindberetningmobil_android.server.SafeJsonHelper.java

@Override
public JSONObject put(String name, boolean value) {
    try {//from w w  w.j  a va 2s . co m
        return super.put(name, value);
    } catch (JSONException e) {
        Logger.getLogger("SafeJsonObject").log(Level.WARNING, "", e);
        return null;
    }
}

From source file:com.notonthehighstreet.ratel.internal.model.Server.java

public static Server toServer(final String environment) {
    String hostName;/* w  w w .j a v  a2  s .  co m*/
    try {
        hostName = InetAddress.getLocalHost().getHostName();
    } catch (UnknownHostException e) {
        LOG.log(Level.WARNING, "Unable to work out host name for localhost!", e);
        hostName = "Unable to work out host name " + e.getMessage();
    }
    return new Server(environment, hostName, ProjectRoot.projectRoot());
}