Coverage Report - org.apache.maven.archiva.common.utils.Slf4JPlexusLogger
 
Classes in this File Line Coverage Branch Coverage Complexity
Slf4JPlexusLogger
0%
0/45
0%
0/10
0
 
 1  
 package org.apache.maven.archiva.common.utils;
 2  
 
 3  
 /*
 4  
  * Licensed to the Apache Software Foundation (ASF) under one
 5  
  * or more contributor license agreements.  See the NOTICE file
 6  
  * distributed with this work for additional information
 7  
  * regarding copyright ownership.  The ASF licenses this file
 8  
  * to you under the Apache License, Version 2.0 (the
 9  
  * "License"); you may not use this file except in compliance
 10  
  * with the License.  You may obtain a copy of the License at
 11  
  *
 12  
  *  http://www.apache.org/licenses/LICENSE-2.0
 13  
  *
 14  
  * Unless required by applicable law or agreed to in writing,
 15  
  * software distributed under the License is distributed on an
 16  
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 17  
  * KIND, either express or implied.  See the License for the
 18  
  * specific language governing permissions and limitations
 19  
  * under the License.
 20  
  */
 21  
 
 22  
 import org.slf4j.Logger;
 23  
 import org.slf4j.LoggerFactory;
 24  
 
 25  
 /**
 26  
  * Slf4JPlexusLogger - temporary logger to provide an Slf4j Logger to those components
 27  
  * outside of the archiva codebase that require a plexus logger.
 28  
  *
 29  
  * @version $Id: Slf4JPlexusLogger.java 718864 2008-11-19 06:33:35Z brett $
 30  
  */
 31  
 public class Slf4JPlexusLogger implements org.codehaus.plexus.logging.Logger {
 32  
     private Logger log;
 33  
 
 34  0
     public Slf4JPlexusLogger(Class<?> clazz) {
 35  0
         log = LoggerFactory.getLogger(clazz);
 36  0
     }
 37  
 
 38  0
     public Slf4JPlexusLogger(String name) {
 39  0
         log = LoggerFactory.getLogger(name);
 40  0
     }
 41  
 
 42  
     public void debug(String message) {
 43  0
         log.debug(message);
 44  0
     }
 45  
 
 46  
     public void debug(String message, Throwable throwable) {
 47  0
         log.debug(message, throwable);
 48  0
     }
 49  
 
 50  
     public void error(String message) {
 51  0
         log.error(message);
 52  0
     }
 53  
 
 54  
     public void error(String message, Throwable throwable) {
 55  0
         log.error(message, throwable);
 56  0
     }
 57  
 
 58  
     public void fatalError(String message) {
 59  0
         log.error(message);
 60  0
     }
 61  
 
 62  
     public void fatalError(String message, Throwable throwable) {
 63  0
         log.error(message, throwable);
 64  0
     }
 65  
 
 66  
     public org.codehaus.plexus.logging.Logger getChildLogger(String name) {
 67  0
         return new Slf4JPlexusLogger(log.getName() + "." + name);
 68  
     }
 69  
 
 70  
     public String getName() {
 71  0
         return log.getName();
 72  
     }
 73  
 
 74  
     public int getThreshold() {
 75  0
         if (log.isTraceEnabled()) {
 76  0
             return org.codehaus.plexus.logging.Logger.LEVEL_DEBUG;
 77  0
         } else if (log.isDebugEnabled()) {
 78  0
             return org.codehaus.plexus.logging.Logger.LEVEL_DEBUG;
 79  0
         } else if (log.isInfoEnabled()) {
 80  0
             return org.codehaus.plexus.logging.Logger.LEVEL_INFO;
 81  0
         } else if (log.isWarnEnabled()) {
 82  0
             return org.codehaus.plexus.logging.Logger.LEVEL_WARN;
 83  0
         } else if (log.isErrorEnabled()) {
 84  0
             return org.codehaus.plexus.logging.Logger.LEVEL_ERROR;
 85  
         }
 86  
 
 87  0
         return org.codehaus.plexus.logging.Logger.LEVEL_DISABLED;
 88  
     }
 89  
 
 90  
     public void info(String message) {
 91  0
         log.info(message);
 92  0
     }
 93  
 
 94  
     public void info(String message, Throwable throwable) {
 95  0
         log.info(message, throwable);
 96  0
     }
 97  
 
 98  
     public boolean isDebugEnabled() {
 99  0
         return log.isDebugEnabled();
 100  
     }
 101  
 
 102  
     public boolean isErrorEnabled() {
 103  0
         return log.isErrorEnabled();
 104  
     }
 105  
 
 106  
     public boolean isFatalErrorEnabled() {
 107  0
         return log.isErrorEnabled();
 108  
     }
 109  
 
 110  
     public boolean isInfoEnabled() {
 111  0
         return log.isInfoEnabled();
 112  
     }
 113  
 
 114  
     public boolean isWarnEnabled() {
 115  0
         return log.isWarnEnabled();
 116  
     }
 117  
 
 118  
     public void setThreshold(int threshold) {
 119  
         /* do nothing */
 120  0
     }
 121  
 
 122  
     public void warn(String message) {
 123  0
         log.warn(message);
 124  0
     }
 125  
 
 126  
     public void warn(String message, Throwable throwable) {
 127  0
         log.warn(message, throwable);
 128  0
     }
 129  
 }