Clover Coverage Report
Coverage timestamp: Fri May 24 2013 13:47:27 UTC
../../../../../img/srcFileCovDistChart9.png 45% of files have more coverage
25   90   20   3.12
24   53   0.8   8
8     2.5  
1    
 
  TraceListener       Line # 25 25 20 89.5% 0.8947368
 
  (7)
 
1    /* This file is part of the project "Hilbert II" - http://www.qedeq.org
2    *
3    * Copyright 2000-2013, 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 org.qedeq.base.trace.Trace;
19   
20    /**
21    * Listener that writes events to the trace.
22    *
23    * @author Michael Meyling
24    */
 
25    public final class TraceListener implements LogListener {
26   
27    /** Last modules URL .*/
28    private String lastModuleUrl = "";
29   
30    /**
31    * Constructor.
32    */
 
33  7 toggle public TraceListener() {
34    // nothing to do
35    }
36   
 
37  2 toggle public final void logMessageState(final String text, final String url) {
38  2 if (!lastModuleUrl.equals(url)) {
39  1 Trace.log(url);
40  1 lastModuleUrl = (url != null ? url : "");
41    }
42  2 Trace.log(" state: " + text);
43    }
44   
 
45  2 toggle public final void logFailureState(final String text, final String url,
46    final String description) {
47  2 if (!lastModuleUrl.equals(url)) {
48  1 Trace.log(url);
49  1 lastModuleUrl = (url != null ? url : "");
50    }
51  2 Trace.log(" failure: " + text, description);
52    }
53   
 
54  2 toggle public final void logSuccessfulState(final String text, final String url) {
55  2 if (!lastModuleUrl.equals(url)) {
56  1 Trace.log(url);
57  1 lastModuleUrl = (url != null ? url : "");
58    }
59  2 Trace.log(" success: " + text);
60    }
61   
 
62  2 toggle public void logRequest(final String text, final String url) {
63  2 if (!lastModuleUrl.equals(url)) {
64  1 Trace.log(url);
65  1 lastModuleUrl = (url != null ? url : "");
66    }
67  2 Trace.log(" request: " + text);
68    }
69   
 
70  2 toggle public final void logMessage(final String text) {
71  2 Trace.log(text);
72    }
73   
 
74  2 toggle public void logSuccessfulReply(final String text, final String url) {
75  2 if (!lastModuleUrl.equals(url)) {
76  1 Trace.log(url);
77  1 lastModuleUrl = (url != null ? url : "");
78    }
79  2 Trace.log(" reply: " + text);
80    }
81   
 
82  2 toggle public void logFailureReply(final String text, final String url, final String description) {
83  2 if (!lastModuleUrl.equals(url)) {
84  1 Trace.log(url);
85  1 lastModuleUrl = (url != null ? url : "");
86    }
87  2 Trace.log(" reply: " + text, description);
88    }
89   
90    }