From f258229b88a797694320b1794a4084998411a94b Mon Sep 17 00:00:00 2001 From: Roel Spilker Date: Mon, 22 Nov 2010 23:52:34 +0100 Subject: - Renamed the diverse @Log annotations to give them distinct names - Removed the option to specify a different class to log on - Updated tests and documentation --- website/features/GetterLazy.html | 2 +- website/features/Log.html | 21 +++++++++------------ 2 files changed, 10 insertions(+), 13 deletions(-) (limited to 'website') diff --git a/website/features/GetterLazy.html b/website/features/GetterLazy.html index a91e782c..d3e47b85 100644 --- a/website/features/GetterLazy.html +++ b/website/features/GetterLazy.html @@ -10,7 +10,7 @@
-

@Getter and @Setter

+

@Getter(lazy=true)

Overview

diff --git a/website/features/Log.html b/website/features/Log.html index c5d7771c..91a06580 100644 --- a/website/features/Log.html +++ b/website/features/Log.html @@ -5,34 +5,31 @@ - @Log + @Log (and friends)
-

@Log

+

@Log (and friends)

Overview

- NEW in lombok 0.10: You can annotate any field with @Log to let lombok generate a logger field automatically.
+ NEW in lombok 0.10: You can annotate any class with a log annotation to let lombok generate a logger field.
The logger is named log and field's type depends on which logger you have selected.

- There are four @Log choices available:
+ There are four choices available:

-
@lombok.extern.apachecommons.Log
+
@CommonsLog
Creates private static final org.apache.commons.logging.Log log = org.apache.commons.logging.LogFactory.getLog(LogExample.class);
-
@lombok.extern.jul.Log
+
@Log
Creates private static final java.util.logging.Logger log = java.util.logging.Logger.getLogger(LogExample.class.getName());
-
@lombok.extern.log4j.Log
+
@Log4j
Creates private static final org.apache.log4j.Logger log = org.apache.log4j.Logger.getLogger(LogExample.class);
-
@lombok.extern.slf4j.Log
+
@Slf4j
Creates private static final org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger(LogExample.class);

-

- All @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. -

@@ -51,7 +48,7 @@

If a field called log already exists, a warning will be emitted and no code will be generated.

- A future feature of lombok's @Log is to find calls to the logger field and, if the chosen logging framework supports + A future feature of lombok's diverse log annotations is to find calls to the logger field and, if the chosen logging framework supports it and the log level can be compile-time determined from the log call, guard it with an if statement. This way if the log statement ends up being ignored, the potentially expensive calculation of the log string is avoided entirely. This does mean that you should NOT put any side-effects in the expression that you log. -- cgit