Skip to content

Commit

Permalink
remove slf4j
Browse files Browse the repository at this point in the history
  • Loading branch information
codeconsole committed Nov 11, 2024
1 parent 7507032 commit e69b605
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 65 deletions.
31 changes: 0 additions & 31 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,6 @@ SECTION 1: BSD-STYLE, MIT-STYLE, OR SIMILAR STYLE LICENSES
>>> dom4j-1.6.1
>>> hsqldb-1.8.0.10
>>> jline-2.11
>>> slf4j-1.7.5



Expand Down Expand Up @@ -392,36 +391,6 @@ Copyright (c) 2002-2007, Marc Prud'hommeaux. All rights reserved.
This software is distributable under the BSD license. See the terms of the
BSD license in the documentation provided with this software.

>>> slf4j-1.7.5

Copyright (c) 2004-2007 QOS.ch
All rights reserved.

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


--------------- SECTION 2: Apache License, V2.0 ----------

Apache License, V2.0 is applicable to the following component(s).


>>> ant-1.9.4

Apache License
Expand Down
3 changes: 1 addition & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,9 @@ subprojects { subproject ->
}

dependencies {
api platform("org.grails:grails-bom:$grailsVersion")
implementation platform("org.grails:grails-bom:$grailsVersion")

api "org.apache.groovy:groovy:$groovyVersion"
api "org.slf4j:slf4j-api"

testImplementation "org.spockframework:spock-core"
testImplementation "org.springframework:spring-test"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@
import org.grails.io.support.GrailsResourceUtils;
import org.grails.plugins.BinaryGrailsPlugin;
import org.grails.taglib.TemplateVariableBinding;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
Expand All @@ -42,6 +40,8 @@
import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.CopyOnWriteArraySet;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
* Used to locate GSPs whether in development or WAR deployed mode from static
Expand All @@ -52,7 +52,8 @@
*/
public class DefaultGroovyPageLocator implements GroovyPageLocator, ResourceLoaderAware, ApplicationContextAware, PluginManagerAware {

private static final Logger LOG = LoggerFactory.getLogger(DefaultGroovyPageLocator.class);
private static final Logger LOG = Logger.getLogger(DefaultGroovyPageLocator.class.getName());

public static final String PATH_TO_WEB_INF_VIEWS = "/WEB-INF/grails-app/views";
private static final String SLASHED_VIEWS_DIR_PATH = "/" + GrailsResourceUtils.VIEWS_DIR_PATH;
private static final String PLUGINS_PATH = "/plugins/";
Expand Down Expand Up @@ -229,13 +230,13 @@ protected GroovyPageScriptSource findBinaryScriptSource(String uri) {
}

BinaryGrailsPlugin binaryPlugin = (BinaryGrailsPlugin) plugin;
if(LOG.isDebugEnabled()) {
LOG.debug("Searching plugin [{}] for GSP view [{}]", plugin.getName(), uri);
if (LOG.isLoggable(Level.FINE)) {
LOG.fine(String.format("Searching plugin [%s] for GSP view [%s]", plugin.getName(), uri));
}
GroovyPageScriptSource scriptSource = resolveViewInBinaryPlugin(binaryPlugin, uri);
if (scriptSource != null) {
if(LOG.isDebugEnabled()) {
LOG.debug("Found GSP view [{}] in plugin [{}]", uri, plugin.getName());
if (LOG.isLoggable(Level.FINE)) {
LOG.fine(String.format("Found GSP view [%s] in plugin [%s]", uri, plugin.getName()));
}
return scriptSource;
}
Expand Down Expand Up @@ -354,22 +355,22 @@ protected GroovyPageScriptSource findResourceScriptPathForSearchPaths(String uri
for (String searchPath : searchPaths) {
String gspClassName = precompiledGspMap.get(searchPath);
if (gspClassName != null && !reloadedPrecompiledGspClassNames.contains(gspClassName)) {
if(LOG.isDebugEnabled()) {
LOG.debug("Found pre-compiled GSP template [{}] for path [{}]", gspClassName, searchPath);
if (LOG.isLoggable(Level.FINE)) {
LOG.fine(String.format("Found pre-compiled GSP template [%s] for path [%s]", gspClassName, searchPath));
}
Class<GroovyPage> gspClass = null;
try {
if(LOG.isDebugEnabled()) {
LOG.debug("Loading GSP template [{}]", gspClassName);
if (LOG.isLoggable(Level.FINE)) {
LOG.fine(String.format("Loading GSP template [%s]", gspClassName));
}
gspClass = (Class<GroovyPage>) Class.forName(gspClassName, true, Thread.currentThread().getContextClassLoader());
} catch (ClassNotFoundException e) {
LOG.warn("Cannot load class " + gspClassName + ". Resuming on non-precompiled implementation.", e);
LOG.log(Level.WARNING, "Cannot load class " + gspClassName + ". Resuming on non-precompiled implementation.", e);
}
if (gspClass != null) {
GroovyPageCompiledScriptSource groovyPageCompiledScriptSource = createGroovyPageCompiledScriptSource(uri, searchPath, gspClass);
if(LOG.isDebugEnabled()) {
LOG.debug("Returning new GSP script source for class [{}]", gspClassName);
if (LOG.isLoggable(Level.FINE)) {
LOG.fine(String.format("Returning new GSP script source for class [%s]", gspClassName));
}
return groovyPageCompiledScriptSource;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import grails.util.GrailsUtil
import grails.util.Metadata
import grails.web.pages.GroovyPagesUriService
import groovy.transform.CompileStatic
import groovy.util.logging.Slf4j
import groovy.util.logging.Log
import org.grails.core.artefact.TagLibArtefactHandler
import org.grails.gsp.GroovyPageResourceLoader
import org.grails.gsp.GroovyPagesTemplateEngine
Expand Down Expand Up @@ -54,7 +54,7 @@ import org.springframework.web.servlet.view.InternalResourceViewResolver
* @author Graeme Rocher
* @since 1.1
*/
@Slf4j
@Log
class GroovyPagesGrailsPlugin extends Plugin {

public static final String GSP_RELOAD_INTERVAL = "grails.gsp.reload.interval"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import grails.config.Config
import grails.core.support.GrailsConfigurationAware
import grails.gsp.TagLib
import groovy.transform.CompileStatic
import groovy.util.logging.Slf4j
import groovy.util.logging.Log
import org.grails.plugins.web.GrailsTagDateHelper

import java.text.DateFormat
Expand Down Expand Up @@ -48,7 +48,7 @@ import org.springframework.web.servlet.support.RequestDataValueProcessor
* @author Graeme Rocher
*/
@TagLib
@Slf4j
@Log
class FormTagLib implements ApplicationContextAware, InitializingBean, TagLibrary, GrailsConfigurationAware {

private static final List<String> DEFAULT_CURRENCY_CODES = ['EUR', 'XCD', 'USD', 'XOF', 'NOK', 'AUD',
Expand Down Expand Up @@ -523,7 +523,7 @@ class FormTagLib implements ApplicationContextAware, InitializingBean, TagLibrar

// Strip out any 'name' attribute, since this tag overrides it.
if (attrs.name) {
log.warn "[actionSubmit] 'name' attribute will be ignored"
log.warning "[actionSubmit] 'name' attribute will be ignored"
attrs.remove('name')
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@

import java.util.HashMap;
import java.util.Map;
import java.util.logging.Logger;

import grails.core.ArtefactHandlerAdapter;
import grails.core.ArtefactInfo;
import grails.core.GrailsClass;
import grails.core.gsp.GrailsTagLibClass;
import org.grails.core.gsp.DefaultGrailsTagLibClass;
import org.slf4j.LoggerFactory;

/**
* Configures tag libraries within namespaces in Grails.
Expand Down Expand Up @@ -69,9 +69,11 @@ public void initialize(ArtefactInfo artefacts) {
else {
GrailsTagLibClass current = tag2libMap.get(tagName);
if (!taglibClass.equals(current)) {
LoggerFactory.getLogger(TagLibArtefactHandler.class).info("There are conflicting tags: " + taglibClass.getFullName() + "." +
tagName + " vs. " + current.getFullName() + "." + tagName +
". The former will take precedence.");
Logger.getLogger(TagLibArtefactHandler.class.getName()).info(
"There are conflicting tags: " + taglibClass.getFullName() + "." +
tagName + " vs. " + current.getFullName() + "." + tagName +
". The former will take precedence."
);
tag2libMap.put(tagName, taglibClass);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ package org.grails.taglib.encoder

import groovy.transform.CompileStatic
import grails.core.GrailsApplication
import groovy.util.logging.Slf4j
import org.grails.encoder.CodecLookupHelper
import org.grails.encoder.Encoder
import org.grails.taglib.encoder.OutputEncodingStackAttributes.Builder
Expand All @@ -29,7 +28,6 @@ import org.grails.taglib.encoder.OutputEncodingStackAttributes.Builder
* @since 2.3
*/
@CompileStatic
@Slf4j
class WithCodecHelper {

/** all is the key to set all codecs at once */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
import org.grails.gsp.io.GroovyPageScriptSource;
import org.grails.web.gsp.io.GrailsConventionGroovyPageLocator;
import org.grails.web.servlet.mvc.GrailsWebRequest;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.core.Ordered;
Expand All @@ -39,6 +37,8 @@
import java.util.concurrent.Callable;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
* Evaluates the existance of a view for different extensions choosing which one to delegate to.
Expand All @@ -47,7 +47,7 @@
* @since 0.1
*/
public class GroovyPageViewResolver extends InternalResourceViewResolver implements GrailsViewResolver {
private static final Logger LOG = LoggerFactory.getLogger(GroovyPageViewResolver.class);
private static final Logger LOG = Logger.getLogger(GroovyPageViewResolver.class.getName());

public static final String GSP_SUFFIX = ".gsp";
public static final String JSP_SUFFIX = ".jsp";
Expand Down Expand Up @@ -187,14 +187,14 @@ protected View createGrailsView(String viewName) throws Exception {

GroovyPageScriptSource scriptSource;
if (controller == null) {
if(LOG.isDebugEnabled()) {
LOG.debug("Locating GSP view for path {}", viewName);
if (LOG.isLoggable(Level.FINE)) {
LOG.fine(String.format("Locating GSP view for path %s", viewName));
}
scriptSource = groovyPageLocator.findViewByPath(viewName);
}
else {
if(LOG.isDebugEnabled()) {
LOG.debug("Locating GSP view for controller {} and path {}",controller, viewName);
if (LOG.isLoggable(Level.FINE)) {
LOG.fine(String.format("Locating GSP view for controller %s and path %s", controller, viewName));
}
scriptSource = groovyPageLocator.findView(controller, viewName);
}
Expand Down

0 comments on commit e69b605

Please sign in to comment.