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