Skip to content

Commit

Permalink
HSEARCH-675 - Replace slf4j with JBoss Logging in LoggerFactory
Browse files Browse the repository at this point in the history
  • Loading branch information
DavideD committed Jun 12, 2011
1 parent 4daf6a6 commit 7c1cba9
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,24 @@
*/
package org.hibernate.search.util.logging.impl;

import org.slf4j.Logger;
import org.jboss.logging.Logger;

/**
* A factory class for class loggers. Allows a creation of loggers after the DRY principle.
*
* @author Hardy Ferentschik
*/
public class LoggerFactory {
public static Logger make() {
public static Log make() {
Throwable t = new Throwable();
StackTraceElement directCaller = t.getStackTrace()[1];
return org.slf4j.LoggerFactory.getLogger( directCaller.getClassName() );
return Logger.getMessageLogger( Log.class, directCaller.getClassName() );
}

public static <T> T make(Class<T> logClass) {
Throwable t = new Throwable();
StackTraceElement directCaller = t.getStackTrace()[1];
return Logger.getMessageLogger( logClass, directCaller.getClassName() );
}
}

0 comments on commit 7c1cba9

Please sign in to comment.