Code example for LogRecord

Methods: getMillis

0
        try { 
            Thread.sleep(2);
        } catch (InterruptedException e) {
            e.printStackTrace();
        } 
        LogRecord lr2 = new LogRecord(Level.CONFIG, "MSG2");
        long after = lr2.getMillis();
        assertTrue(after-before>0);
    } 
 
    public void testGetSetLevelNormal() { 
        assertSame(lr.getLevel(), Level.CONFIG);
        lr.setLevel(Level.ALL);
        assertSame(lr.getLevel(), Level.ALL);
        lr.setLevel(Level.FINEST);
        assertSame(lr.getLevel(), Level.FINEST);
    } 
 
    public void testGetSetThreadID_DifferentThread() { 
        lr.getThreadID();
        // Create and start the thread