KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > codehaus > dna > impl > MockLogger


1 /*
2  * Copyright (C) The DNA Group. All rights reserved.
3  *
4  * This software is published under the terms of the DNA
5  * Software License version 1.1, a copy of which has been included
6  * with this distribution in the LICENSE.txt file.
7  */

8 package org.codehaus.dna.impl;
9
10 import java.util.logging.Level JavaDoc;
11 import java.util.logging.LogRecord JavaDoc;
12 import java.util.logging.Logger JavaDoc;
13
14 class MockLogger
15     extends Logger JavaDoc
16 {
17     boolean m_output;
18     Level JavaDoc m_priority;
19     String JavaDoc m_message;
20     Throwable JavaDoc m_throwable;
21
22     public MockLogger( final Level JavaDoc level )
23     {
24         super( "test", null );
25         setLevel( level );
26     }
27
28     public void log( final LogRecord JavaDoc record )
29     {
30         m_output = true;
31         m_priority = record.getLevel();
32         m_message = record.getMessage();
33         m_throwable = record.getThrown();
34     }
35 }
36
Popular Tags