Code example for FileHandler

Methods: close

0
        r = new LogRecord(Level.CONFIG, "msg");
    } 
 
    protected void tearDown() throws Exception { 
        if (null != handler) {
            handler.close();
        } 
        reset(TEMPPATH + SEP + "log", "");
        // RoboVM note: Since we run the tests in the same process (and Android apparently doesn't) 
        // we need to clear the allLocks Map in FileHandler for all tests in here to succeed. 
        java.lang.reflect.Field f = FileHandler.class.getDeclaredField("allLocks");
        f.setAccessible(true);
        ((java.util.Map) f.get(null)).clear();
        super.tearDown(); 
    } 
 
    public static InputStream propertiesToInputStream(Properties p) throws IOException {
        ByteArrayOutputStream bos = new ByteArrayOutputStream();
        p.store(bos, "");
        return new ByteArrayInputStream(bos.toByteArray());
    }