From d1addc14d5c2430c2b9fbea3081884d4f9d62a4c Mon Sep 17 00:00:00 2001
From: Roel Spilker
+ You can annotate any field with
+ There are four
+ All
+ If a field called
+ Although it is possible to specify any class literal to pass to the logger factory method, passing @Log
+
+ Overview
+ @Log to let lombok generate a logger field automatically.
+ The logger is named log and field's type depends on which logger you have selected.
+ @Log choices available:
+
+
+
+ @lombok.commons.Logprivate static final org.apache.commons.logging.Log log = org.apache.commons.logging.LogFactory.getLog(TargetType.class);@lombok.jul.Logprivate static final java.util.logging.Logger log = java.util.logging.Logger.getLogger(TargetType.class.getName());@lombok.log4j.Logprivate static final org.apache.log4j.Logger log = org.apache.log4j.Logger.getLogger(TargetType.class);@lombok.slf4j.Logprivate static final org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger(TargetType.class);@Log annotations can take an optional parameter of type Class. If such a parameter is specified, that class will be used as the parameter for the logger factory call.
+ With Lombok
+ Vanilla Java
+ Small print
log already exists, a warning will be emitted and no code will be generated.
+ void.class will be considered to be the same as specifying no parameter.
+
There are four @Log choices available:
@lombok.commons.Logprivate static final org.apache.commons.logging.Log log = org.apache.commons.logging.LogFactory.getLog(TargetType.class);@lombok.jul.Logprivate static final java.util.logging.Logger log = java.util.logging.Logger.getLogger(TargetType.class.getName());@lombok.log4j.Logprivate static final org.apache.log4j.Logger log = org.apache.log4j.Logger.getLogger(TargetType.class);@lombok.slf4j.Logprivate static final org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger(TargetType.class);@lombok.extern.apachecommons.Logprivate static final org.apache.commons.logging.Log log = org.apache.commons.logging.LogFactory.getLog(LogExample.class);@lombok.extern.jul.Logprivate static final java.util.logging.Logger log = java.util.logging.Logger.getLogger(LogExample.class.getName());@lombok.extern.log4j.Logprivate static final org.apache.log4j.Logger log = org.apache.log4j.Logger.getLogger(LogExample.class);@lombok.extern.slf4j.Logprivate static final org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger(LogExample.class);
--
cgit
From 1f0db1191a7fcc35aaeab1481a806201a450d797 Mon Sep 17 00:00:00 2001
From: Roel Spilker
If a field called
- Although it is possible to specify any class literal to pass to the logger factory method, passing log already exists, a warning will be emitted and no code will be generated.
void.class will be considered to be the same as specifying no parameter.
-