Skip to content

Commit

Permalink
KEYCLOAK-1280: i18n logging for org.keycloak.provider
Browse files Browse the repository at this point in the history
  • Loading branch information
ssilvert committed Jan 21, 2016
1 parent 0de4170 commit 1f04676
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 6 deletions.
@@ -1,6 +1,22 @@
/*
* Copyright 2016 Red Hat Inc. and/or its affiliates and other contributors
* as indicated by the @author tags. All rights reserved.
*
* Licensed 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 org.keycloak.provider; package org.keycloak.provider;


import org.jboss.logging.Logger; import org.keycloak.services.ServicesLogger;


import java.io.File; import java.io.File;
import java.io.FilenameFilter; import java.io.FilenameFilter;
Expand All @@ -14,7 +30,7 @@
*/ */
public class FileSystemProviderLoaderFactory implements ProviderLoaderFactory { public class FileSystemProviderLoaderFactory implements ProviderLoaderFactory {


private static final Logger log = Logger.getLogger(FileSystemProviderLoaderFactory.class); private static final ServicesLogger logger = ServicesLogger.ROOT_LOGGER;


@Override @Override
public boolean supports(String type) { public boolean supports(String type) {
Expand Down Expand Up @@ -43,7 +59,7 @@ private static URLClassLoader createClassLoader(ClassLoader parent, String... fi
} }
} }


log.debug("Loading providers from " + urls.toString()); logger.debug("Loading providers from " + urls.toString());


return new URLClassLoader(urls.toArray(new URL[urls.size()]), parent); return new URLClassLoader(urls.toArray(new URL[urls.size()]), parent);
} catch (Exception e) { } catch (Exception e) {
Expand Down
22 changes: 19 additions & 3 deletions services/src/main/java/org/keycloak/provider/ProviderManager.java
@@ -1,6 +1,22 @@
/*
* Copyright 2016 Red Hat Inc. and/or its affiliates and other contributors
* as indicated by the @author tags. All rights reserved.
*
* Licensed 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 org.keycloak.provider; package org.keycloak.provider;


import org.jboss.logging.Logger; import org.keycloak.services.ServicesLogger;


import java.util.HashMap; import java.util.HashMap;
import java.util.IdentityHashMap; import java.util.IdentityHashMap;
Expand All @@ -14,7 +30,7 @@
*/ */
public class ProviderManager { public class ProviderManager {


private static final Logger log = Logger.getLogger(ProviderManager.class); private static final ServicesLogger logger = ServicesLogger.ROOT_LOGGER;


private List<ProviderLoader> loaders = new LinkedList<ProviderLoader>(); private List<ProviderLoader> loaders = new LinkedList<ProviderLoader>();
private Map<String, List<ProviderFactory>> cache = new HashMap<String, List<ProviderFactory>>(); private Map<String, List<ProviderFactory>> cache = new HashMap<String, List<ProviderFactory>>();
Expand All @@ -25,7 +41,7 @@ public ProviderManager(ClassLoader baseClassLoader, String... resources) {
factories.add(f); factories.add(f);
} }


log.debugv("Provider loaders {0}", factories); logger.debugv("Provider loaders {0}", factories);


loaders.add(new DefaultProviderLoader(baseClassLoader)); loaders.add(new DefaultProviderLoader(baseClassLoader));


Expand Down

0 comments on commit 1f04676

Please sign in to comment.