EMMA Coverage Report (generated Fri Feb 14 08:28:31 UTC 2014)
[all classes][org.qedeq.kernel.bo.log]

COVERAGE SUMMARY FOR SOURCE FILE [ModuleLogListenerImpl.java]

nameclass, %method, %block, %line, %
ModuleLogListenerImpl.java100% (1/1)50%  (2/4)78%  (31/40)67%  (8/12)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class ModuleLogListenerImpl100% (1/1)50%  (2/4)78%  (31/40)67%  (8/12)
ModuleLogListenerImpl (String): void 0%   (0/1)0%   (0/5)0%   (0/2)
setPrintStream (PrintStream): void 0%   (0/1)0%   (0/4)0%   (0/2)
ModuleLogListenerImpl (String, PrintStream): void 100% (1/1)100% (12/12)100% (5/5)
logMessageState (String): void 100% (1/1)100% (19/19)100% (3/3)

1/* This file is part of the project "Hilbert II" - http://www.qedeq.org
2 *
3 * Copyright 2000-2014,  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 
16package org.qedeq.kernel.bo.log;
17 
18import java.io.PrintStream;
19 
20import org.qedeq.base.utility.DateUtility;
21 
22/**
23 * Listener that writes events to a stream.
24 *
25 * @author  Michael Meyling
26 */
27public final class ModuleLogListenerImpl implements ModuleLogListener {
28 
29    /** Stream for output. */
30    private PrintStream out = System.out;
31 
32    /** For this module we are logging. */
33    private final String moduleUrl;
34 
35    /**
36     * Constructor.
37     *
38     * @param   moduleUrl   We log for this module.
39     */
40    public ModuleLogListenerImpl(final String moduleUrl) {
41        this(moduleUrl, System.out);
42    }
43 
44    /**
45     * Constructor.
46     *
47     * @param   moduleUrl   We log for this module.
48     * @param   stream      Print to this stream.
49     */
50    public ModuleLogListenerImpl(final String moduleUrl, final PrintStream stream) {
51        this.moduleUrl = moduleUrl;
52        this.out = stream;
53    }
54 
55    /**
56     * Set output stream.
57     *
58     * @param   stream  Output stream.
59     */
60    public final void setPrintStream(final PrintStream stream) {
61        this.out = stream;
62    }
63 
64    public final void logMessageState(final String text) {
65        out.println(moduleUrl);
66        out.println(DateUtility.getTimestamp() + " state:   " + text);
67    }
68 
69}

[all classes][org.qedeq.kernel.bo.log]
EMMA 2.1.5320 (stable) (C) Vladimir Roubtsov