[java-support] branch master updated: JPAR-128 - Upgrade Velocity to 2.0
Scott Cantor
cantor.2 at osu.edu
Wed Jan 23 12:15:45 EST 2019
This is an automated email from the git hooks/post-receive script.
scantor pushed a commit to branch master
in repository java-support.
View the commit online:
http://git.shibboleth.net/view/?p=java-support.git;a=commit;h=c83367f1f85204fccfe3486d31d11fec916debe1
The following commit(s) were added to refs/heads/master by this push:
new c83367f JPAR-128 - Upgrade Velocity to 2.0
c83367f is described below
commit c83367f1f85204fccfe3486d31d11fec916debe1
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Wed Jan 23 12:15:42 2019 -0500
JPAR-128 - Upgrade Velocity to 2.0
https://issues.shibboleth.net/jira/browse/JPAR-128
---
pom.xml | 2 +-
.../java/support/velocity/SLF4JLogChute.java | 124 ---------------------
2 files changed, 1 insertion(+), 125 deletions(-)
diff --git a/pom.xml b/pom.xml
index a374802..1e13c07 100644
--- a/pom.xml
+++ b/pom.xml
@@ -104,7 +104,7 @@
<dependency>
<!-- Required if you're using classes from the velocity package -->
<groupId>org.apache.velocity</groupId>
- <artifactId>velocity</artifactId>
+ <artifactId>velocity-engine-core</artifactId>
<optional>true</optional>
</dependency>
<dependency>
diff --git a/src/main/java/net/shibboleth/utilities/java/support/velocity/SLF4JLogChute.java b/src/main/java/net/shibboleth/utilities/java/support/velocity/SLF4JLogChute.java
deleted file mode 100644
index ae91ddb..0000000
--- a/src/main/java/net/shibboleth/utilities/java/support/velocity/SLF4JLogChute.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
- * Licensed to the University Corporation for Advanced Internet Development,
- * Inc. (UCAID) under one or more contributor license agreements. See the
- * NOTICE file distributed with this work for additional information regarding
- * copyright ownership. The UCAID licenses this file to You 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 net.shibboleth.utilities.java.support.velocity;
-
-import org.apache.velocity.runtime.RuntimeServices;
-import org.apache.velocity.runtime.log.LogChute;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Redirects Velocity's LogChute messages to SLF4J.
- *
- * <p>To use, first set up SLF4J, then tell Velocity to use
- * this class for logging by adding the following to your velocity.properties:
- *
- * <code>
- * runtime.log.logsystem.class = edu.internet2.middleware.shibboleth.common.util.Slf4jLogChute
- * </code>
- * </p>
- *
- * <p>You may also set this property to specify what log/name Velocity's
- * messages should be logged to (example below is default).
- * <code>
- * runtime.log.logsystem.slf4j.name = org.apache.velocity
- * </code>
- * </p>
- */
-public class SLF4JLogChute implements LogChute {
-
- /** Property key for specifying the name for the log instance. */
- public static final String LOGCHUTE_SLF4J_NAME = "runtime.log.logsystem.slf4j.name";
-
- /** Default name for the commons-logging instance. */
- public static final String DEFAULT_LOG_NAME = "org.apache.velocity";
-
- /** The Slf4J Logger instance. */
- private Logger log;
-
- /** {@inheritDoc} */
- public void init(final RuntimeServices rs) throws Exception {
- String name = (String) rs.getProperty(LOGCHUTE_SLF4J_NAME);
- if (name == null) {
- name = DEFAULT_LOG_NAME;
- }
- log = LoggerFactory.getLogger(name);
- log(LogChute.DEBUG_ID, "SLF4JLogChute name is '" + name + "'");
- }
-
- /** {@inheritDoc} */
- public boolean isLevelEnabled(final int level) {
- switch (level) {
- case LogChute.DEBUG_ID:
- return log.isDebugEnabled();
- case LogChute.INFO_ID:
- return log.isInfoEnabled();
- case LogChute.TRACE_ID:
- return log.isTraceEnabled();
- case LogChute.WARN_ID:
- return log.isWarnEnabled();
- case LogChute.ERROR_ID:
- return log.isErrorEnabled();
- default:
- return true;
- }
- }
-
- /** {@inheritDoc} */
- public void log(final int level, final String message) {
- switch (level) {
- case LogChute.ERROR_ID:
- log.error(message);
- break;
- case LogChute.WARN_ID:
- log.warn(message);
- break;
- case LogChute.INFO_ID:
- log.info(message);
- break;
- case LogChute.TRACE_ID:
- log.trace(message);
- break;
- case LogChute.DEBUG_ID:
- default:
- log.debug(message);
- }
- }
-
- /** {@inheritDoc} */
- public void log(final int level, final String message, final Throwable t) {
- switch (level) {
- case LogChute.ERROR_ID:
- log.error(message, t);
- break;
- case LogChute.WARN_ID:
- log.warn(message, t);
- break;
- case LogChute.INFO_ID:
- log.info(message, t);
- break;
- case LogChute.TRACE_ID:
- log.trace(message, t);
- break;
- case LogChute.DEBUG_ID:
- default:
- log.debug(message, t);
- }
- }
-
-}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list