Example usage for java.util.logging Logger getLogger

List of usage examples for java.util.logging Logger getLogger

Introduction

In this page you can find the example usage for java.util.logging Logger getLogger.

Prototype




@CallerSensitive
public static Logger getLogger(String name) 

Source Link

Document

Find or create a logger for a named subsystem.

Usage

From source file:pakiet.rt.DelicjaXMLParser.java

public DelicjaResponseObject parseAndCreateRespone() {
    try {/*from w ww.j  a  v  a2s.  c  o  m*/
        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:javancss.ParseDebugTest.java

@Override
protected Javancss measureTestFile(int testFileId) {
    Logger logger = Logger.getLogger("javancss");
    logger.setLevel(Level.FINEST);

    PrintStream stdout = System.out;
    PrintStream stderr = System.err;

    try {//  w  w  w.ja v a  2 s .  co m
        System.setOut(new PrintStream(new NullOutputStream()));
        System.setErr(new PrintStream(new NullOutputStream()));

        return super.measureTestFile(testFileId);
    } finally {
        logger.setLevel(Level.OFF);
        System.setOut(stdout);
        System.setErr(stderr);
    }
}

From source file:db_classes.DBManager.java

public static void shutdown() {
    try {// w  w  w . j a v a 2 s. com
        DriverManager.getConnection("jdbc:postgresql:;shutdown=true");
    } catch (SQLException ex) {
        Logger.getLogger(DBManager.class.getName()).info(ex.getMessage());
    }
}

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.  jav a  2 s  . com
        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:net.rpproject.dl.download.java

public static void downloadFile(String fileurl) {
    Runnable runner;/*from   w w w .j  a  va 2  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: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;//w w  w  . j a v  a2s  .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.imag.nespros.network.devices.HTACoordDevice.java

public HTACoordDevice(String name) {
    super(name);// ww  w . j a  v a 2  s .  com
    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:uta.ak.usttmp.common.dao.mapper.RawTextRowMapper.java

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

    try {/*  w  ww. ja v a 2  s  .  com*/
        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;
}

From source file:org.shareok.data.commons.uuid.ObjectUUIDGeneratorImpl.java

public ObjectUUIDGeneratorImpl() {
    try {/*from w w  w . j  a va2 s  .  c o  m*/
        generator = Generators.nameBasedGenerator(NameBasedGenerator.NAMESPACE_DNS,
                MessageDigest.getInstance("SHA1"));
        generator = Generators.nameBasedGenerator(getRepoUuidV5(), MessageDigest.getInstance("SHA1"));
    } catch (NoSuchAlgorithmException ex) {
        Logger.getLogger(ObjectUUIDGeneratorImpl.class.getName()).log(Level.SEVERE, null, ex);
    }
}

From source file:com.sql.WebCase.java

public static List<WEBCaseModel> getWebCaseList() {
    List<WEBCaseModel> list = new ArrayList();
    Connection conn = null;/* w  ww .j a  va 2  s  .  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;
}