List of usage examples for java.util.logging Logger getLogger
@CallerSensitive public static Logger getLogger(String name)
From source file:net.nharyes.drivecopy.Main.java
public static void main(String[] args) { // set logger handler Logger logger = Logger.getLogger(Main.class.getPackage().getName()); logger.setUseParentHandlers(false);/* w w w .j ava 2 s . c o m*/ logger.addHandler(new SystemOutHandler()); logger.setLevel(Level.FINE); new Main(args); }
From source file:com.rr.generic.ui.security.ContextProfileInitializer.java
public void initialize(ConfigurableWebApplicationContext ctx) { ConfigurableEnvironment environment = ctx.getEnvironment(); String hostname = null;/*from w w w . j a va 2s . co m*/ String profiles = "local"; try { hostname = InetAddress.getLocalHost().getHostAddress(); } catch (UnknownHostException ex) { Logger.getLogger(ContextProfileInitializer.class.getName()).log(Level.SEVERE, null, ex); } if ("172.24.16.43".equals(hostname)) { profiles = "staging"; } else if ("172.24.32.41".equals(hostname)) { profiles = "prod"; } environment.setActiveProfiles(profiles); }
From source file:com.ut.healthelink.security.ContextProfileInitializer.java
public void initialize(ConfigurableWebApplicationContext ctx) { ConfigurableEnvironment environment = ctx.getEnvironment(); String hostname = null;/*from w w w . ja v a2 s . c om*/ String profiles = "local"; try { hostname = InetAddress.getLocalHost().getHostAddress(); } catch (UnknownHostException ex) { Logger.getLogger(ContextProfileInitializer.class.getName()).log(Level.SEVERE, null, ex); } if ("10.202.52.54".equals(hostname)) { profiles = "healthelink-test"; } else if ("10.202.52.152".equals(hostname)) { profiles = "healthelink-prod"; } environment.setActiveProfiles(profiles); }
From source file:com.boldust.math001.Math001Test.java
/** * Test of pow001 method, of class Math001. *//*from ww w . ja va 2s.co m*/ @Test public void testPow001() { System.out.println("pow001"); Logger l = Logger.getLogger("powtest001"); // l.addHandler(new java.util.logging.ConsoleHandler()); l.log(Level.SEVERE, "Powtest001"); int base = 20; int exp = 5; BigInteger expResult = new BigInteger(Integer.valueOf(3200000).toString()); BigInteger result1 = new BigInteger(Integer.valueOf(3200000).toString()); BigInteger result = Math001.pow001(base, exp); System.out.println(expResult.equals(result)); assertEquals(expResult, result); assertEquals(result1, result); // TODO review the generated test code and remove the default call to fail. //fail("The test case is a prototype."); }
From source file:com.imag.nespros.network.devices.DCDevice.java
public DCDevice(String name) { super(name);//from w ww . ja v a2s . co m this.setCpuSpeed(100); this.setTotalMemory(512); this.setDeviceType(DeviceType.DC); this.setDeviceName(name); try { byte[] imageInByte; imageInByte = IOUtils.toByteArray(getClass().getClassLoader().getResourceAsStream("image/dc.jpeg")); icon = new MyLayeredIcon(new ImageIcon(imageInByte).getImage()); } catch (IOException ex) { Logger.getLogger(AMIDevice.class.getName()).log(Level.SEVERE, null, ex); } }
From source file:com.app.inventario.logica.FamiliaLogicaImpl.java
@Transactional public void guardar(Familia familia) throws Exception { try {//from www. j av a 2 s .c om familiaDAO.guardar(familia); } catch (HibernateException he) { Logger.getLogger(FamiliaLogicaImpl.class.getName()).log(Level.SEVERE, null, he); throw he; } }
From source file:service.FilesServiceImpl.java
@Override public void add(MultipartFile file, UsersEntity usersEntity) { FilesEntity fileEntity;//from w ww.j ava2s . c om try { fileEntity = new FilesEntity(file.getName(), file.getContentType(), file.getBytes(), usersEntity); this.filesDao.save(fileEntity); } catch (IOException ex) { Logger.getLogger(FilesServiceImpl.class.getName()).log(Level.SEVERE, null, ex); } }
From source file:controller.NewEntryDeleteControllerTest.java
@AfterClass public static void tearDownClass() { File file = new File(System.getProperty("user.dir") + fSeparator + "MyDiaryBook"); try {/*from www.java2 s. co m*/ FileUtils.deleteDirectory(file); } catch (IOException ex) { Logger.getLogger(NewEntryDeleteControllerTest.class.getName()).log(Level.SEVERE, null, ex); } }
From source file:com.grameenfoundation.ictc.utils.XMLParser.java
public static Document parseXmlText(String requestType) { //get the factory DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); try {/*from ww w . ja v a 2s. c o m*/ //Using factory get an instance of document builder DocumentBuilder db = dbf.newDocumentBuilder(); //InputSource is = new InputSource(); //is.setCharacterStream(new StringReader(data)); //File f = new File("/home/nii-amon/Documents/cardlessXML/XMLFile.xml"); File f = new File(requestType); //File f = new File("/home/nii-amon/Documents/cardlessXML/txnType.xml"); Document doc = db.parse(f); // normalize text representation doc.getDocumentElement().normalize(); System.out.println("Root element of the doc is " + doc.getDocumentElement().getNodeName()); return doc; } catch (ParserConfigurationException pce) { //Log.info("ParserConfigurationException. Reason: "+pce.getMessage()); pce.printStackTrace(); return null; } catch (IOException ioe) { //Log.info("IOException. Reason: "+ioe.getMessage()); ioe.printStackTrace(); return null; } catch (org.xml.sax.SAXException ex) { Logger.getLogger(XMLParser.class.getName()).log(Level.SEVERE, null, ex); } return null; }
From source file:com.kahlon.guard.controller.example.SimpleBean.java
public String saveRecord() { Logger.getLogger(this.getClass().getName()).log(Level.INFO, "Save Record works"); return null; }