Skip to content

Commit

Permalink
logX usage
Browse files Browse the repository at this point in the history
  • Loading branch information
nickarls committed Mar 15, 2010
1 parent fd43226 commit d100fba
Showing 1 changed file with 9 additions and 2 deletions.
Expand Up @@ -40,6 +40,8 @@
import org.jboss.weld.util.collections.EnumerationList;
import org.jboss.weld.util.reflection.SecureReflections;
import org.slf4j.cal10n.LocLogger;
import org.slf4j.ext.XLogger;
import org.slf4j.ext.XLogger.Level;

/**
* This class handles looking up service providers on the class path. It
Expand All @@ -60,7 +62,8 @@
public class DefaultServiceLoader<S> implements Iterable<S>
{
private static LocLogger log = loggerFactory().getLogger(UTIL);

private static XLogger logX = loggerFactory().getXLogger(UTIL);

private static final String SERVICES = "META-INF/services";

/**
Expand Down Expand Up @@ -204,7 +207,8 @@ private void loadServiceFile(URL serviceFile)
}
catch (IOException e)
{
throw new ForbiddenStateException(COULD_NOT_READ_SERVICES_FILE, serviceFile, e);
logX.throwing(Level.ERROR, e);
throw new ForbiddenStateException(COULD_NOT_READ_SERVICES_FILE, serviceFile);
}
finally
{
Expand Down Expand Up @@ -251,10 +255,12 @@ private Class<? extends S> loadClass(String serviceClassName)
}
catch (ClassNotFoundException e)
{
logX.throwing(Level.ERROR, e);
throw new ForbiddenStateException(EXTENSION_CLASS_NOT_FOUND, serviceClassName);
}
catch (ClassCastException e)
{
logX.throwing(Level.ERROR, e);
throw new ForbiddenStateException(DECLARED_EXTENSION_DOES_NOT_IMPLEMENT_EXTENSION, serviceClassName);
}
return serviceClass;
Expand All @@ -269,6 +275,7 @@ private S prepareInstance(Class<? extends S> serviceClass)
}
catch (Exception e)
{
logX.throwing(Level.ERROR, e);
throw new ForbiddenStateException(SECURITY_EXCEPTION_SCANNING, serviceClass, e);
}
}
Expand Down

0 comments on commit d100fba

Please sign in to comment.