All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.sonar.maven.SonarMavenEmbedderLogger Maven / Gradle / Ivy

/*
 * Sonar, open source software quality management tool.
 * Copyright (C) 2009 SonarSource SA
 * mailto:contact AT sonarsource DOT com
 *
 * Sonar is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 3 of the License, or (at your option) any later version.
 *
 * Sonar is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with Sonar; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02
 */
package org.sonar.maven;

import org.apache.maven.embedder.MavenEmbedderLogger;
import org.apache.maven.plugin.logging.Log;

public class SonarMavenEmbedderLogger implements MavenEmbedderLogger {

  private Log logger;
  
  public SonarMavenEmbedderLogger(Log logger) {
    super();
    this.logger = logger;
  }

  public void debug(String message) {
    logger.debug(message);
  }

  public void debug(String message, Throwable throwable) {
    logger.debug(message, throwable);
  }

  public void error(String message) {
    logger.error(message);
  }

  public void error(String message, Throwable throwable) {
    logger.error(message, throwable);
  }

  public void fatalError(String message) {
    logger.error(message);
  }

  public void fatalError(String message, Throwable throwable) {
    logger.error(message, throwable);
  }
  
  public void info(String message) {
    logger.info(message);
  }

  public void info(String message, Throwable throwable) {
    logger.info(message, throwable);
  }
  
  public void warn(String message) {
    logger.warn(message);
  }

  public void warn(String message, Throwable throwable) {
    logger.warn(message, throwable);
  }

  public int getThreshold() {
    if ( logger.isDebugEnabled() ) return LEVEL_DEBUG;
    if ( logger.isInfoEnabled() ) return LEVEL_INFO;
    if ( logger.isWarnEnabled() ) return LEVEL_WARN;
    if ( logger.isErrorEnabled() ) return LEVEL_FATAL;
    return LEVEL_DISABLED;
  }

  public boolean isDebugEnabled() {
    return logger.isDebugEnabled();
  }

  public boolean isErrorEnabled() {
    return logger.isErrorEnabled();
  }

  public boolean isFatalErrorEnabled() {
    return logger.isErrorEnabled();
  }

  public boolean isInfoEnabled() {
    return logger.isInfoEnabled();
  }

  public boolean isWarnEnabled() {
    return logger.isWarnEnabled();
  }

  public void setThreshold(int threshold) {
    throw new IllegalArgumentException("Unable to se the Threshold for this logger impl");
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy