Example usage for java.util.logging Level SEVERE

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

Introduction

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

Prototype

Level SEVERE

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

Click Source Link

Document

SEVERE is a message level indicating a serious failure.

Usage

From source file:com.symbian.driver.plugins.comms.stat.StatProxy.java

public JStat getStat() {
    try {/*  ww  w . j  a  va 2 s. co m*/
        iTransport = TDConfig.getInstance().getPreference(TDConfig.TRANSPORT);
    } catch (ParseException lParseException) {
        LOGGER.log(Level.SEVERE, "Failed to get config", lParseException);
        iTransport = "serial1";
    }
    return JStat.getInstance(iTransport);
}

From source file:net.rpproject.dl.download.java

public static void downloadFile(String fileurl) {
    Runnable runner;/*from   www.  j  a va2 s  .c  o  m*/
    runner = () -> {
        try {
            fileDownloader(fileurl);
        } catch (IOException ex) {
            Logger.getLogger(window.class.getName()).log(Level.SEVERE, null, ex);
        }
    };
    Thread t = new Thread(runner, "RRP Download Thread");
    t.start();
}

From source file:pakiet.rt.DelicjaXMLParser.java

public DelicjaResponseObject parseAndCreateRespone() {
    try {// ww w  .  j av  a2  s .com
        parse();
    } catch (SAXException ex) {
        Logger.getLogger(DelicjaXMLParser.class.getName()).log(Level.SEVERE, null, ex);
    } catch (IOException ex) {
        Logger.getLogger(DelicjaXMLParser.class.getName()).log(Level.SEVERE, null, ex);
    } catch (XPathExpressionException ex) {
        Logger.getLogger(DelicjaXMLParser.class.getName()).log(Level.SEVERE, null, ex);
    } catch (ParserConfigurationException ex) {
        Logger.getLogger(DelicjaXMLParser.class.getName()).log(Level.SEVERE, null, ex);
    }
    return resp;
}

From source file:es.us.isa.aml.parsers.agreements.yaml.ParserYAMLUtil.java

public static String convertToYaml(String jsonContent) {
    Map<String, String> propertyMap = new HashMap<String, String>();
    ObjectMapper mapper = new ObjectMapper();
    try {/*from   w w  w.  j  ava 2s  .  c om*/
        propertyMap = mapper.readValue(jsonContent, new TypeReference<HashMap<String, Object>>() {
        });
    } catch (IOException ex) {
        Logger.getLogger(ParserYAMLUtil.class.getName()).log(Level.SEVERE, null, ex);
    }
    Yaml yaml = new Yaml();
    String output = yaml.dump(propertyMap);
    return output;
}

From source file:at.bitfire.davdroid.log.LogcatHandler.java

@Override
public void publish(LogRecord r) {
    String text = getFormatter().format(r);
    int level = r.getLevel().intValue();

    int end = text.length();
    for (int pos = 0; pos < end; pos += MAX_LINE_LENGTH) {
        String line = text.substring(pos, NumberUtils.min(pos + MAX_LINE_LENGTH, end));

        if (level >= Level.SEVERE.intValue())
            Log.e(r.getLoggerName(), line);
        else if (level >= Level.WARNING.intValue())
            Log.w(r.getLoggerName(), line);
        else if (level >= Level.CONFIG.intValue())
            Log.i(r.getLoggerName(), line);
        else if (level >= Level.FINER.intValue())
            Log.d(r.getLoggerName(), line);
        else//from  ww  w .  j a va2  s  . co  m
            Log.v(r.getLoggerName(), line);
    }
}

From source file:com.imag.nespros.network.devices.HTACoordDevice.java

public HTACoordDevice(String name) {
    super(name);//w  w  w.j  a va  2  s .c om
    this.setCpuSpeed(500);
    this.setTotalMemory(16000);
    this.setDeviceType(DeviceType.HTA_COORD);
    this.setDeviceName(name);
    try {
        byte[] imageInByte;
        imageInByte = IOUtils
                .toByteArray(getClass().getClassLoader().getResourceAsStream("image/htaCoord.jpg"));
        icon = new MyLayeredIcon(new ImageIcon(imageInByte).getImage());
    } catch (IOException ex) {
        Logger.getLogger(AMIDevice.class.getName()).log(Level.SEVERE, null, ex);
    }
}

From source file:io.selendroid.standalone.io.ShellCommand.java

public static String exec(CommandLine commandline, long timeoutInMillies) throws ShellCommandException {
    log.info("Executing shell command: " + commandline);
    PrintingLogOutputStream outputStream = new PrintingLogOutputStream();
    DefaultExecutor exec = new DefaultExecutor();
    exec.setWatchdog(new ExecuteWatchdog(timeoutInMillies));
    PumpStreamHandler streamHandler = new PumpStreamHandler(outputStream);
    exec.setStreamHandler(streamHandler);
    try {/*  w  w  w .ja  va 2  s  .c  om*/
        exec.execute(commandline);
    } catch (Exception e) {
        log.log(Level.SEVERE, "Error executing command: " + commandline, e);
        if (e.getMessage().contains("device offline")) {
            throw new DeviceOfflineException(e);
        }
        throw new ShellCommandException("Error executing shell command: " + commandline,
                new ShellCommandException(outputStream.getOutput()));
    }
    String result = outputStream.getOutput().trim();
    log.info("Shell command output\n-->\n" + result + "\n<--");
    return result;
}

From source file:Tools.HttpClientUtil.java

public static String getRequest(List<KeyValuePair> paramList) {
    HttpClient client = new DefaultHttpClient();
    String paramStr = Utils.getParamsURL(paramList);

    HttpGet request = new HttpGet(Constant.SERVER_URL + Constant.LOGIN_SERVLET + paramStr);
    System.out.println("$Total Request URL:" + Constant.SERVER_URL + Constant.LOGIN_SERVLET + paramStr);
    HttpResponse response;//from   w w  w . j av  a  2 s  .c o  m
    StringBuilder sb = new StringBuilder();
    try {
        response = client.execute(request);
        BufferedReader rd = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));

        String line = "";
        while ((line = rd.readLine()) != null) {
            System.out.println("#" + response.getStatusLine());
            sb.append(line);
        }
    } catch (IOException ex) {
        Logger.getLogger(HttpClientUtil.class.getName()).log(Level.SEVERE, null, ex);
    }

    return sb.toString();
}

From source file:com.sql.WebCase.java

public static List<WEBCaseModel> getWebCaseList() {
    List<WEBCaseModel> list = new ArrayList();
    Connection conn = null;/* www .  ja va  2s.co  m*/
    PreparedStatement ps = null;
    ResultSet rs = null;
    try {
        conn = DBConnection.connectToDB();

        String sql = "SELECT" + " CMDSCase.CaseYear," + " CMDSCase.caseNumber," + " CMDSCase.casemonth,"
                + " CMDSCase.casetype," + " Users.initials AS ALJ," + " CMDSCase.groupNumber"
                + " FROM CMDSCase " + " LEFT JOIN Users ON" + " CMDSCase.aljID = Users.id"
                + " WHERE (CMDSCase.caseYear > YEAR(GETDATE()) - 5) "
                + " ORDER BY CMDSCase.caseyear, CMDSCase.caseNumber";
        ps = conn.prepareStatement(sql);
        rs = ps.executeQuery();
        while (rs.next()) {
            WEBCaseModel item = new WEBCaseModel();
            item.setYear(rs.getString("caseyear") == null ? "" : rs.getString("caseyear"));
            item.setCaseSeqNumber(rs.getString("caseNumber") == null ? "" : rs.getString("caseNumber"));
            item.setMonth(rs.getString("casemonth") == null ? "" : rs.getString("casemonth"));
            item.setType(rs.getString("casetype") == null ? "" : rs.getString("casetype"));
            item.setALJ(rs.getString("ALJ") == null ? "" : rs.getString("ALJ"));
            item.setGroupNumber(rs.getString("groupNumber") == null ? "" : rs.getString("groupNumber"));
            list.add(item);
        }
    } catch (SQLException ex) {
        Logger.getLogger(WebCase.class.getName()).log(Level.SEVERE, null, ex);
    } finally {
        DbUtils.closeQuietly(conn);
        DbUtils.closeQuietly(ps);
        DbUtils.closeQuietly(rs);
    }
    return list;
}

From source file:uta.ak.usttmp.common.dao.mapper.RawTextRowMapper.java

@Override
public Object mapRow(ResultSet rs, int rowNum) throws SQLException {

    try {//from  w  ww . j a v  a  2s .  c om
        RawText rt = new RawText();
        rt.setId(rs.getLong("mme_eid"));

        SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        rt.setCreateTime(formatter.parse(rs.getString("text_createdate")));

        rt.setText(rs.getString("text"));
        rt.setTitle(rs.getString("title"));
        rt.setTag(rs.getString("tag"));

        return rt;
    } catch (ParseException ex) {
        Logger.getLogger(RawTextRowMapper.class.getName()).log(Level.SEVERE, null, ex);
    }

    return null;
}