1 // $Id: LoggerFactory.java 15354 2008-10-15 15:14:25Z hardy.ferentschik $
2 /*
3 * JBoss, Home of Professional Open Source
4 * Copyright 2008, Red Hat Middleware LLC, and individual contributors
5 * by the @authors tag. See the copyright.txt in the distribution for a
6 * full listing of individual contributors.
7 *
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 */
18 package org.hibernate.search.util;
19
20 import org.slf4j.Logger;
21
22 /**
23 * A factory class for class loggers. Allows a creation of loggers after the DRY principle.
24 *
25 * @author Hardy Ferentschik
26 */
27 public class LoggerFactory {
28 public static Logger make() {
29 Throwable t = new Throwable();
30 StackTraceElement directCaller = t.getStackTrace()[1];
31 return org.slf4j.LoggerFactory.getLogger( directCaller.getClassName() );
32 }
33 }
34