Example usage for org.apache.maven.execution MavenExecutionRequest LOGGING_LEVEL_WARN

List of usage examples for org.apache.maven.execution MavenExecutionRequest LOGGING_LEVEL_WARN

Introduction

In this page you can find the example usage for org.apache.maven.execution MavenExecutionRequest LOGGING_LEVEL_WARN.

Prototype

int LOGGING_LEVEL_WARN

To view the source code for org.apache.maven.execution MavenExecutionRequest LOGGING_LEVEL_WARN.

Click Source Link

Usage

From source file:org.universaal.tools.packaging.tool.preferences.EclipsePreferencesConfigurator.java

License:Apache License

public int getMavenLogLevel(String message) {

    Map<String, Integer> enumeration = new HashMap<String, Integer>();
    enumeration.put("DEBUG", MavenExecutionRequest.LOGGING_LEVEL_DEBUG);
    enumeration.put("INFO", MavenExecutionRequest.LOGGING_LEVEL_INFO);
    enumeration.put("WARN", MavenExecutionRequest.LOGGING_LEVEL_WARN);
    enumeration.put("ERROR", MavenExecutionRequest.LOGGING_LEVEL_ERROR);
    enumeration.put("FATAL", MavenExecutionRequest.LOGGING_LEVEL_FATAL);
    enumeration.put("DISABLED", MavenExecutionRequest.LOGGING_LEVEL_DISABLED);

    for (String key : enumeration.keySet()) {
        if (message.contains(key))
            return enumeration.get(key);
    }//w w  w .ja  v a  2  s . c  o m
    return 4;
}

From source file:org.universaal.tools.packaging.tool.preferences.EclipsePreferencesConfigurator.java

License:Apache License

public int getLogLevel() {
    String levelName = getString(ConfigProperties.LOG_LEVEL_KEY, ConfigProperties.LOG_LEVEL_DEFAULT);
    if ("DEBUG".equalsIgnoreCase(levelName)) {
        return MavenExecutionRequest.LOGGING_LEVEL_DEBUG;
    } else if ("WARN".equalsIgnoreCase(levelName)) {
        return MavenExecutionRequest.LOGGING_LEVEL_WARN;
    } else if ("ERROR".equalsIgnoreCase(levelName)) {
        return MavenExecutionRequest.LOGGING_LEVEL_ERROR;
    } else if ("FATAL".equalsIgnoreCase(levelName)) {
        return MavenExecutionRequest.LOGGING_LEVEL_FATAL;
    } else if ("DISABLED".equalsIgnoreCase(levelName)) {
        return MavenExecutionRequest.LOGGING_LEVEL_DISABLED;
    } else if ("INFO".equalsIgnoreCase(levelName)) {
        return MavenExecutionRequest.LOGGING_LEVEL_INFO;
    }//  w  w w  .  j a  v  a2  s .  com
    System.err.println("Unable to get log level from enviroment using DEBUG level");
    return MavenExecutionRequest.LOGGING_LEVEL_DEBUG;
}

From source file:org.universaal.tools.packaging.tool.preferences.SystemPropertiesConfigurator.java

License:Apache License

private int getLogLevel(final String levelName) {
    if ("DEBUG".equalsIgnoreCase(levelName)) {
        return MavenExecutionRequest.LOGGING_LEVEL_DEBUG;
    } else if ("WARN".equalsIgnoreCase(levelName)) {
        return MavenExecutionRequest.LOGGING_LEVEL_WARN;
    } else if ("ERROR".equalsIgnoreCase(levelName)) {
        return MavenExecutionRequest.LOGGING_LEVEL_ERROR;
    } else if ("FATAL".equalsIgnoreCase(levelName)) {
        return MavenExecutionRequest.LOGGING_LEVEL_FATAL;
    } else if ("DISABLED".equalsIgnoreCase(levelName)) {
        return MavenExecutionRequest.LOGGING_LEVEL_DISABLED;
    } else if ("INFO".equalsIgnoreCase(levelName)) {
        return MavenExecutionRequest.LOGGING_LEVEL_INFO;
    }/*from   ww w  .  j av  a  2 s  . c o  m*/
    System.err.println("Unable to get log level from enviroment using DEBUG level");
    return MavenExecutionRequest.LOGGING_LEVEL_DEBUG;
}