码迷,mamicode.com
首页 > 其他好文 > 详细

Lombok(1.14.8) - @Log

时间:2015-08-02 06:17:19      阅读:150      评论:0      收藏:0      [点我收藏+]

标签:

@Log

@Logs,生成一个日志对象。

package com.huey.lombok;

import lombok.extern.java.Log;

@Log
public class LogExample {

    public static void main(String[] args) {
        log.info("This is an info message.");        
    }

}

 

除了,Log还有其他annotation来封装一些主流的日志类库:
@CommonsLog
Creates private static final org.apache.commons.logging.Log log = org.apache.commons.logging.LogFactory.getLog(Foo.class);
@Log
Creates private static final java.util.logging.Logger log = java.util.logging.Logger.getLogger(Foo.class.getName());
@Log4j
Creates private static final org.apache.log4j.Logger log = org.apache.log4j.Logger.getLogger(Foo.class);
@Log4j2
Creates private static final org.apache.logging.log4j.Logger log = org.apache.logging.log4j.LogManager.getLogger(Foo.class);
@Slf4j
Creates private static final org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger(Foo.class);
@XSlf4j
Creates private static final org.slf4j.ext.XLogger log = org.slf4j.ext.XLoggerFactory.getXLogger(Foo.class);

Lombok(1.14.8) - @Log

标签:

原文地址:http://www.cnblogs.com/huey/p/4694975.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!