EMMA Coverage Report (generated Sun Apr 20 22:38:01 CEST 2008)
[all classes][net.sf.wraplog]

COVERAGE SUMMARY FOR SOURCE FILE [Logger.java]

nameclass, %method, %block, %line, %
Logger.java100% (1/1)100% (4/4)80%  (41/51)88%  (11.4/13)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class Logger100% (1/1)100% (4/4)80%  (41/51)88%  (11.4/13)
getLogger (Class): Logger 100% (1/1)55%  (6/11)67%  (2/3)
getLogger (String): Logger 100% (1/1)84%  (26/31)91%  (6.4/7)
<static initializer> 100% (1/1)100% (5/5)100% (1/1)
Logger (String): void 100% (1/1)100% (4/4)100% (2/2)

1// Jomic - a viewer for comic book archives.
2// Copyright (C) 2004-2008 Thomas Aglassinger
3//
4// This program is free software: you can redistribute it and/or modify
5// it under the terms of the GNU General Public License as published by
6// the Free Software Foundation, either version 3 of the License, or
7// (at your option) any later version.
8//
9// This program is distributed in the hope that it will be useful,
10// but WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12// GNU General Public License for more details.
13//
14// You should have received a copy of the GNU General Public License
15// along with this program.  If not, see <http://www.gnu.org/licenses/>.
16package net.sf.wraplog;
17 
18import java.util.HashMap;
19import java.util.Map;
20 
21/**
22 *  Wrapped Logger for Log4j.
23 *
24 * @author    Thomas Aglassinger
25 */
26public class Logger extends Log4jLogger
27{
28    private static Map loggerMap = new HashMap();
29 
30    public Logger(String name) {
31        super(name);
32    }
33 
34    public static Logger getLogger(String name) {
35        Logger result;
36 
37        synchronized (loggerMap) {
38            result = (Logger) loggerMap.get(name);
39            if (result == null) {
40                result = new Logger(name);
41                loggerMap.put(name, result);
42            }
43        }
44        return result;
45    }
46 
47    public static Logger getLogger(Class clazz) {
48        if (clazz == null) {
49            // No localization needed because this will fail before localization is setup.
50            throw new NullPointerException("parameter clazz must not be null");
51        }
52        return getLogger(clazz.getName());
53    }
54}

[all classes][net.sf.wraplog]
EMMA 2.0.4217 (C) Vladimir Roubtsov