1 /* Copyright 2009, Sebastian Prehn
2 *
3 * This file is part of JCR Blog.
4 *
5 * JCR Blog is free software: you can redistribute it and/or modify
6 * it under the terms of the Lesser GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * JCR Blog is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the Lesser GNU General Public License
16 * along with JCR Blog. If not, see <http://www.gnu.org/licenses/>.
17 *
18 * Versioning:
19 * $LastChangedDate: 2010-07-24 18:57:21 +0200 (Sa, 24 Jul 2010) $
20 * $LastChangedRevision: 194 $
21 */
22 package org.jcr_blog.commons;
23
24 import java.io.Serializable;
25 import javax.enterprise.inject.Produces;
26 import javax.enterprise.inject.spi.InjectionPoint;
27 import org.slf4j.Logger;
28 import org.slf4j.LoggerFactory;
29
30 /**
31 * This service produces a Logger.
32 * @author Sebastian Prehn <sebastian.prehn@planetswebdesign.de>
33 */
34 public class LoggerProvider implements Serializable {
35
36 @Produces
37 Logger getLogger(InjectionPoint injectionPoint) {
38 return LoggerFactory.getLogger(injectionPoint.getMember().getDeclaringClass());
39 }
40 }