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;
11  import java.util.logging.LogRecord;
12  import java.util.logging.Logger;
13  
14  class MockLogger
15      extends Logger
16  {
17      boolean m_output;
18      Level m_priority;
19      String m_message;
20      Throwable m_throwable;
21  
22      public MockLogger( final Level level )
23      {
24          super( "test", null );
25          setLevel( level );
26      }
27  
28      public void log( final LogRecord record )
29      {
30          m_output = true;
31          m_priority = record.getLevel();
32          m_message = record.getMessage();
33          m_throwable = record.getThrown();
34      }
35  }