EMMA Coverage Report (generated Mon Oct 17 05:41:20 EDT 2011)
[all classes][org.jclouds.logging.slf4j]

COVERAGE SUMMARY FOR SOURCE FILE [SLF4JLogger.java]

nameclass, %method, %block, %line, %
SLF4JLogger.java100% (2/2)25%  (4/16)28%  (22/79)27%  (7/26)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class SLF4JLogger100% (1/1)14%  (2/14)17%  (12/69)21%  (5/24)
isDebugEnabled (): boolean 0%   (0/1)0%   (0/4)0%   (0/1)
isErrorEnabled (): boolean 0%   (0/1)0%   (0/4)0%   (0/1)
isInfoEnabled (): boolean 0%   (0/1)0%   (0/4)0%   (0/1)
isTraceEnabled (): boolean 0%   (0/1)0%   (0/4)0%   (0/1)
isWarnEnabled (): boolean 0%   (0/1)0%   (0/4)0%   (0/1)
logDebug (String): void 0%   (0/1)0%   (0/5)0%   (0/2)
logError (String): void 0%   (0/1)0%   (0/5)0%   (0/2)
logError (String, Throwable): void 0%   (0/1)0%   (0/6)0%   (0/2)
logInfo (String): void 0%   (0/1)0%   (0/5)0%   (0/2)
logTrace (String): void 0%   (0/1)0%   (0/5)0%   (0/2)
logWarn (String): void 0%   (0/1)0%   (0/5)0%   (0/2)
logWarn (String, Throwable): void 0%   (0/1)0%   (0/6)0%   (0/2)
SLF4JLogger (String, Logger): void 100% (1/1)100% (9/9)100% (4/4)
getCategory (): String 100% (1/1)100% (3/3)100% (1/1)
     
class SLF4JLogger$SLF4JLoggerFactory100% (1/1)100% (2/2)100% (10/10)100% (2/2)
SLF4JLogger$SLF4JLoggerFactory (): void 100% (1/1)100% (3/3)100% (1/1)
getLogger (String): Logger 100% (1/1)100% (7/7)100% (1/1)

1/**
2 * Licensed to jclouds, Inc. (jclouds) under one or more
3 * contributor license agreements.  See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership.  jclouds licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License.  You may obtain a copy of the License at
9 *
10 *   http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing,
13 * software distributed under the License is distributed on an
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 * KIND, either express or implied.  See the License for the
16 * specific language governing permissions and limitations
17 * under the License.
18 */
19package org.jclouds.logging.slf4j;
20 
21import org.jclouds.logging.BaseLogger;
22import org.jclouds.logging.Logger;
23 
24/**
25 * {@link org.apache.slf4j.Logger} implementation of {@link Logger}.
26 * 
27 * @author Adrian Cole
28 * 
29 */
30public class SLF4JLogger extends BaseLogger {
31   private final org.slf4j.Logger logger;
32   private final String category;
33 
34   public static class SLF4JLoggerFactory implements LoggerFactory {
35      public Logger getLogger(String category) {
36         return new SLF4JLogger(category, org.slf4j.LoggerFactory.getLogger(category));
37      }
38   }
39 
40   public SLF4JLogger(String category, org.slf4j.Logger logger) {
41      this.category = category;
42      this.logger = logger;
43   }
44 
45   @Override
46   protected void logTrace(String message) {
47      logger.trace(message);
48   }
49 
50   public boolean isTraceEnabled() {
51      return logger.isTraceEnabled();
52   }
53 
54   @Override
55   protected void logDebug(String message) {
56      logger.debug(message);
57   }
58 
59   public boolean isDebugEnabled() {
60      return logger.isDebugEnabled();
61   }
62 
63   @Override
64   protected void logInfo(String message) {
65      logger.info(message);
66   }
67 
68   public boolean isInfoEnabled() {
69      return logger.isInfoEnabled();
70   }
71 
72   @Override
73   protected void logWarn(String message) {
74      logger.warn(message);
75   }
76 
77   @Override
78   protected void logWarn(String message, Throwable e) {
79      logger.warn(message, e);
80   }
81 
82   public boolean isWarnEnabled() {
83      return logger.isWarnEnabled();
84   }
85 
86   @Override
87   protected void logError(String message) {
88      logger.error(message);
89   }
90 
91   @Override
92   protected void logError(String message, Throwable e) {
93      logger.error(message, e);
94   }
95 
96   public boolean isErrorEnabled() {
97      return logger.isErrorEnabled();
98   }
99 
100   public String getCategory() {
101      return category;
102   }
103}

[all classes][org.jclouds.logging.slf4j]
EMMA 2.0.5312 (C) Vladimir Roubtsov