Clover Coverage Report
Coverage timestamp: Sa Aug 2 2008 13:56:27 CEST
../../../../../img/srcFileCovDistChart2.png 87% of files have more coverage
10   92   10   1
0   39   1   10
10     1  
1    
 
  LogListenerImpl       Line # 31 10 10 20% 0.2
 
No Tests
 
1    /* $Id: LogListenerImpl.java,v 1.1 2008/07/26 07:58:29 m31 Exp $
2    *
3    * This file is part of the project "Hilbert II" - http://www.qedeq.org
4    *
5    * Copyright 2000-2008, Michael Meyling <mime@qedeq.org>.
6    *
7    * "Hilbert II" is free software; you can redistribute
8    * it and/or modify it under the terms of the GNU General Public
9    * License as published by the Free Software Foundation; either
10    * version 2 of the License, or (at your option) any later version.
11    *
12    * This program is distributed in the hope that it will be useful,
13    * but WITHOUT ANY WARRANTY; without even the implied warranty of
14    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15    * GNU General Public License for more details.
16    */
17   
18    package org.qedeq.kernel.bo.log;
19   
20    import java.io.PrintStream;
21    import java.net.URL;
22   
23    import org.qedeq.base.utility.DateUtility;
24   
25    /**
26    * Listener that writes events to a stream.
27    *
28    * @version $Revision: 1.1 $
29    * @author Michael Meyling
30    */
 
31    public final class LogListenerImpl implements LogListener {
32   
33    /** Stream for output. */
34    private PrintStream out = System.out;
35   
36    /**
37    * Constructor.
38    */
 
39  39 toggle public LogListenerImpl() {
40  39 this(System.out);
41    }
42   
43    /**
44    * Constructor.
45    *
46    * @param stream Print to this stream.
47    */
 
48  39 toggle public LogListenerImpl(final PrintStream stream) {
49  39 this.out = stream;
50    }
51   
52    /**
53    * Set output stream.
54    *
55    * @param stream Output stream.
56    */
 
57  0 toggle public final void setPrintStream(final PrintStream stream) {
58  0 this.out = stream;
59    }
60   
 
61  0 toggle public final void logMessageState(final String text, final URL url) {
62  0 out.println(DateUtility.getTimestamp() + " state: " + text + "\n\t" + url);
63    }
64   
 
65  0 toggle public final void logFailureState(final String text, final URL url,
66    final String description) {
67  0 out.println(DateUtility.getTimestamp() + " failure: " + text + "\n\t" + url + "\n\t"
68    + description);
69    }
70   
 
71  0 toggle public final void logSuccessfulState(final String text, final URL url) {
72  0 out.println(DateUtility.getTimestamp() + " success: " + text + "\n\t" + url);
73    }
74   
 
75  0 toggle public void logRequest(final String text) {
76  0 out.println(DateUtility.getTimestamp() + " request: " + text);
77    }
78   
 
79  0 toggle public final void logMessage(final String text) {
80  0 out.println(DateUtility.getTimestamp() + " " + text);
81    }
82   
83   
 
84  0 toggle public void logSuccessfulReply(final String text) {
85  0 out.println(DateUtility.getTimestamp() + " reply: " + text);
86    }
87   
 
88  0 toggle public void logFailureReply(final String text, final String description) {
89  0 out.println(DateUtility.getTimestamp() + " reply: " + text + "\n\t" + description);
90    }
91   
92    }