1 package org.apache.archiva.common.utils;
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
12 * http://www.apache.org/licenses/LICENSE-2.0
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
22 import org.slf4j.Logger;
23 import org.slf4j.LoggerFactory;
26 * Slf4JPlexusLogger - temporary logger to provide an Slf4j Logger to those components
27 * outside of the archiva codebase that require a plexus logger.
31 public class Slf4JPlexusLogger
32 implements org.codehaus.plexus.logging.Logger
36 public Slf4JPlexusLogger( Class<?> clazz )
38 log = LoggerFactory.getLogger( clazz );
41 public Slf4JPlexusLogger( String name )
43 log = LoggerFactory.getLogger( name );
46 public void debug( String message )
51 public void debug( String message, Throwable throwable )
53 log.debug( message, throwable );
56 public void error( String message )
61 public void error( String message, Throwable throwable )
63 log.error( message, throwable );
66 public void fatalError( String message )
71 public void fatalError( String message, Throwable throwable )
73 log.error( message, throwable );
76 public org.codehaus.plexus.logging.Logger getChildLogger( String name )
78 return new Slf4JPlexusLogger( log.getName() + "." + name );
81 public String getName()
86 public int getThreshold()
88 if ( log.isTraceEnabled() )
90 return org.codehaus.plexus.logging.Logger.LEVEL_DEBUG;
92 else if ( log.isDebugEnabled() )
94 return org.codehaus.plexus.logging.Logger.LEVEL_DEBUG;
96 else if ( log.isInfoEnabled() )
98 return org.codehaus.plexus.logging.Logger.LEVEL_INFO;
100 else if ( log.isWarnEnabled() )
102 return org.codehaus.plexus.logging.Logger.LEVEL_WARN;
104 else if ( log.isErrorEnabled() )
106 return org.codehaus.plexus.logging.Logger.LEVEL_ERROR;
109 return org.codehaus.plexus.logging.Logger.LEVEL_DISABLED;
112 public void info( String message )
117 public void info( String message, Throwable throwable )
119 log.info( message, throwable );
122 public boolean isDebugEnabled()
124 return log.isDebugEnabled();
127 public boolean isErrorEnabled()
129 return log.isErrorEnabled();
132 public boolean isFatalErrorEnabled()
134 return log.isErrorEnabled();
137 public boolean isInfoEnabled()
139 return log.isInfoEnabled();
142 public boolean isWarnEnabled()
144 return log.isWarnEnabled();
147 public void setThreshold( int threshold )
152 public void warn( String message )
157 public void warn( String message, Throwable throwable )
159 log.warn( message, throwable );