mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-12 16:35:45 +01:00
remove logback loading messages
This commit is contained in:
@@ -35,6 +35,9 @@ package sonia.scm.cli;
|
|||||||
|
|
||||||
//~--- non-JDK imports --------------------------------------------------------
|
//~--- non-JDK imports --------------------------------------------------------
|
||||||
|
|
||||||
|
import ch.qos.logback.classic.Level;
|
||||||
|
import ch.qos.logback.classic.LoggerContext;
|
||||||
|
|
||||||
import org.kohsuke.args4j.Argument;
|
import org.kohsuke.args4j.Argument;
|
||||||
import org.kohsuke.args4j.CmdLineException;
|
import org.kohsuke.args4j.CmdLineException;
|
||||||
import org.kohsuke.args4j.CmdLineParser;
|
import org.kohsuke.args4j.CmdLineParser;
|
||||||
@@ -146,6 +149,7 @@ public class App
|
|||||||
System.exit(1);
|
System.exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
configureLogger();
|
||||||
loadConfig();
|
loadConfig();
|
||||||
|
|
||||||
I18n i18n = new I18n();
|
I18n i18n = new I18n();
|
||||||
@@ -164,6 +168,17 @@ public class App
|
|||||||
IOUtil.close(output);
|
IOUtil.close(output);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Method description
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
private void configureLogger()
|
||||||
|
{
|
||||||
|
LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory();
|
||||||
|
|
||||||
|
lc.getLogger(Logger.ROOT_LOGGER_NAME).setLevel(loggingLevel);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Method description
|
* Method description
|
||||||
*
|
*
|
||||||
@@ -278,6 +293,15 @@ public class App
|
|||||||
/** Field description */
|
/** Field description */
|
||||||
private BufferedReader input;
|
private BufferedReader input;
|
||||||
|
|
||||||
|
/** Field description */
|
||||||
|
@Option(
|
||||||
|
name = "--logging-level",
|
||||||
|
usage = "optionLoggingLevel",
|
||||||
|
handler = LoggingLevelOptionHandler.class,
|
||||||
|
aliases = { "-l" }
|
||||||
|
)
|
||||||
|
private Level loggingLevel = Level.ERROR;
|
||||||
|
|
||||||
/** Field description */
|
/** Field description */
|
||||||
private PrintWriter output;
|
private PrintWriter output;
|
||||||
|
|
||||||
|
|||||||
@@ -56,6 +56,9 @@ public class I18n
|
|||||||
/** Field description */
|
/** Field description */
|
||||||
public static final String GROUP_NOT_FOUND = "groupNotFound";
|
public static final String GROUP_NOT_FOUND = "groupNotFound";
|
||||||
|
|
||||||
|
/** Field description */
|
||||||
|
public static final String LEVEL = "level";
|
||||||
|
|
||||||
/** Field description */
|
/** Field description */
|
||||||
public static final String OPTIONS = "options";
|
public static final String OPTIONS = "options";
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,104 @@
|
|||||||
|
/**
|
||||||
|
* Copyright (c) 2010, Sebastian Sdorra
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer in the documentation
|
||||||
|
* and/or other materials provided with the distribution.
|
||||||
|
* 3. Neither the name of SCM-Manager; nor the names of its
|
||||||
|
* contributors may be used to endorse or promote products derived from this
|
||||||
|
* software without specific prior written permission.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
|
* DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||||
|
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
|
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||||
|
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
|
* http://bitbucket.org/sdorra/scm-manager
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
package sonia.scm.cli;
|
||||||
|
|
||||||
|
//~--- non-JDK imports --------------------------------------------------------
|
||||||
|
|
||||||
|
import ch.qos.logback.classic.Level;
|
||||||
|
|
||||||
|
import org.kohsuke.args4j.CmdLineException;
|
||||||
|
import org.kohsuke.args4j.CmdLineParser;
|
||||||
|
import org.kohsuke.args4j.OptionDef;
|
||||||
|
import org.kohsuke.args4j.spi.OptionHandler;
|
||||||
|
import org.kohsuke.args4j.spi.Parameters;
|
||||||
|
import org.kohsuke.args4j.spi.Setter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author Sebastian Sdorra
|
||||||
|
*/
|
||||||
|
public class LoggingLevelOptionHandler extends OptionHandler<Level>
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructs ...
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @param parser
|
||||||
|
* @param option
|
||||||
|
* @param setter
|
||||||
|
*/
|
||||||
|
public LoggingLevelOptionHandler(CmdLineParser parser, OptionDef option,
|
||||||
|
Setter<? super Level> setter)
|
||||||
|
{
|
||||||
|
super(parser, option, setter);
|
||||||
|
}
|
||||||
|
|
||||||
|
//~--- methods --------------------------------------------------------------
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Method description
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @param params
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*
|
||||||
|
* @throws CmdLineException
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int parseArguments(Parameters params) throws CmdLineException
|
||||||
|
{
|
||||||
|
String value = params.getParameter(0);
|
||||||
|
Level l = Level.toLevel(value);
|
||||||
|
|
||||||
|
setter.addValue(l);
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
//~--- get methods ----------------------------------------------------------
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Method description
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public String getDefaultMetaVariable()
|
||||||
|
{
|
||||||
|
return I18n.LEVEL;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
|
|
||||||
<!--
|
|
||||||
Document : logback.xml
|
|
||||||
Created on : May 14, 2011, 5:00 PM
|
|
||||||
Author : sdorra
|
|
||||||
Description:
|
|
||||||
Purpose of the document follows.
|
|
||||||
-->
|
|
||||||
|
|
||||||
<configuration>
|
|
||||||
|
|
||||||
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
|
|
||||||
<!-- encoders are by default assigned the type
|
|
||||||
ch.qos.logback.classic.encoder.PatternLayoutEncoder -->
|
|
||||||
<encoder>
|
|
||||||
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger - %msg%n</pattern>
|
|
||||||
</encoder>
|
|
||||||
</appender>
|
|
||||||
|
|
||||||
<logger name="sonia.scm.cli" level="ERROR" />
|
|
||||||
|
|
||||||
<root level="ERROR">
|
|
||||||
<appender-ref ref="STDOUT" />
|
|
||||||
</root>
|
|
||||||
|
|
||||||
</configuration>
|
|
||||||
@@ -38,6 +38,7 @@ optionServerUrl = SCM-Manager URL
|
|||||||
optionUsername = Username
|
optionUsername = Username
|
||||||
optionPassword = Password
|
optionPassword = Password
|
||||||
optionHelpText = Shows this help
|
optionHelpText = Shows this help
|
||||||
|
optionLoggingLevel = Logging level (DEBUG, INFO, WARN, ERROR)
|
||||||
optionTemplate = Template
|
optionTemplate = Template
|
||||||
optionTemplateFile = Template file
|
optionTemplateFile = Template file
|
||||||
optionRepositoryId = Repository Id
|
optionRepositoryId = Repository Id
|
||||||
@@ -80,6 +81,7 @@ misc = Miscellaneous
|
|||||||
repository = Repository
|
repository = Repository
|
||||||
group = Group
|
group = Group
|
||||||
user = User
|
user = User
|
||||||
|
level = Logging-Level
|
||||||
|
|
||||||
options = Options
|
options = Options
|
||||||
usage = scm-cli-client [options] command [command options]
|
usage = scm-cli-client [options] command [command options]
|
||||||
|
|||||||
Reference in New Issue
Block a user