org.slf4j.impl.Loggers Maven / Gradle / Ivy
Show all versions of buildinfo-maven-plugin Show documentation
/**
* Copyright (C) 2006-2014 phloc systems
* http://www.phloc.com
* office[at]phloc[dot]com
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.slf4j.impl;
import org.apache.maven.plugin.logging.Log;
import org.slf4j.ILoggerFactory;
import org.slf4j.Logger;
/**
* Implementation of {@link ILoggerFactory} returning the appropriate named
* {@link Slf4jAdapter} instance.
*
* The class is thread-safe.
*
* @author Yegor Bugayenko ([email protected])
* @version $Id$
* @since 0.1.6
* @see SLF4J FAQ
*/
final class Loggers implements ILoggerFactory
{
/**
* The adapter between SLF4J and Maven.
*/
private final transient Slf4jAdapter m_aAdapter = new Slf4jAdapter ();
/**
* {@inheritDoc}
*/
@Override
public Logger getLogger (final String name)
{
if (name == null)
throw new IllegalArgumentException ("logger name can't be NULL");
return m_aAdapter;
}
/**
* Set Maven log.
*
* @param log
* The log to set
*/
public void setMavenLog (final Log log)
{
m_aAdapter.setMavenLog (log);
}
}