From d1addc14d5c2430c2b9fbea3081884d4f9d62a4c Mon Sep 17 00:00:00 2001 From: Roel Spilker Date: Sat, 6 Nov 2010 22:01:18 +0100 Subject: Updated website documentation to include @Log --- website/features/Log.html | 76 ++++++++++++++++++++++++++++++++++++++ website/features/SneakyThrows.html | 2 +- website/features/features.css | 29 +++++++++++++++ website/features/index.html | 2 + 4 files changed, 108 insertions(+), 1 deletion(-) create mode 100644 website/features/Log.html (limited to 'website') diff --git a/website/features/Log.html b/website/features/Log.html new file mode 100644 index 00000000..45beca77 --- /dev/null +++ b/website/features/Log.html @@ -0,0 +1,76 @@ + + + + + + + + @Log +
+
+
+ +

@Log

+ +
+

Overview

+

+ You can annotate any field with @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. +

+ There are four @Log choices available:
+

+
@lombok.commons.Log
+
Creates private static final org.apache.commons.logging.Log log = org.apache.commons.logging.LogFactory.getLog(TargetType.class);
+
@lombok.jul.Log
+
Creates private static final java.util.logging.Logger log = java.util.logging.Logger.getLogger(TargetType.class.getName());
+
@lombok.log4j.Log
+
Creates private static final org.apache.log4j.Logger log = org.apache.log4j.Logger.getLogger(TargetType.class);
+
@lombok.slf4j.Log
+
Creates private static final org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger(TargetType.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. +

+
+
+
+

With Lombok

+
@HTML_PRE@
+
+
+
+

Vanilla Java

+
@HTML_POST@
+
+
+
+
+

Small print

+

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

+

+ Although it is possible to specify any class literal to pass to the logger factory method, passing void.class will be considered to be the same as specifying no parameter. +

+
+
+ +
+
+
+ + + diff --git a/website/features/SneakyThrows.html b/website/features/SneakyThrows.html index ec7d09c5..0781f083 100644 --- a/website/features/SneakyThrows.html +++ b/website/features/SneakyThrows.html @@ -71,7 +71,7 @@
diff --git a/website/features/features.css b/website/features/features.css index 5de41654..a7e8e318 100644 --- a/website/features/features.css +++ b/website/features/features.css @@ -64,6 +64,15 @@ h1 { margin-left: 32px; } +dt { + margin-top: 4px; + font-size: 1.2em; +} + +dd { + margin-left: 16px; +} + .overview code { font-size: 1.1em; } @@ -138,3 +147,23 @@ h1 { font-style: normal; font-weight: bold; } + +code a { + color: black; + text-decoration: none; +} + +code a:hover { + color: black; + text-decoration: underline; +} + +code .keyword { + color: #7f0055; + font-weight: bold; +} + +code .staticfield { + color: #2a00ff; + font-style: italic; +} \ No newline at end of file diff --git a/website/features/index.html b/website/features/index.html index 869bbe89..d216ddb4 100644 --- a/website/features/index.html +++ b/website/features/index.html @@ -30,6 +30,8 @@
synchronized done right: Don't expose your locks.
@SneakyThrows
To boldly throw checked exceptions where no one has thrown them before!
+
@Log
+
Captain's Log, stardate 24435.7: "What was that line again?"
-- cgit From 8e7334a50535ef33189c3e71fcab0d9e625c6534 Mon Sep 17 00:00:00 2001 From: Roel Spilker Date: Sat, 6 Nov 2010 23:29:43 +0100 Subject: Updated documentation on @Log and moved them all to lombok.extern.* --- buildScripts/website.ant.xml | 4 +- src/core/lombok/commons/Log.java | 34 ---------- src/core/lombok/eclipse/handlers/HandleLog.java | 32 ++++----- src/core/lombok/extern/apachecommons/Log.java | 77 ++++++++++++++++++++++ src/core/lombok/extern/jul/Log.java | 77 ++++++++++++++++++++++ src/core/lombok/extern/log4j/Log.java | 77 ++++++++++++++++++++++ src/core/lombok/extern/slf4j/Log.java | 76 +++++++++++++++++++++ src/core/lombok/javac/handlers/HandleLog.java | 32 ++++----- src/core/lombok/jul/Log.java | 34 ---------- src/core/lombok/log4j/Log.java | 34 ---------- src/core/lombok/slf4j/Log.java | 34 ---------- test/pretty/resource/after/Interfaces.java | 4 +- .../resource/after-ecj/LoggerCommons.java | 6 +- test/transform/resource/after-ecj/LoggerJul.java | 6 +- test/transform/resource/after-ecj/LoggerLog4j.java | 6 +- test/transform/resource/after-ecj/LoggerSlf4j.java | 4 +- .../after-ecj/LoggerSlf4jAlreadyExists.java | 2 +- .../after-ecj/LoggerSlf4jClassOfArray.java | 2 +- .../resource/after-ecj/LoggerSlf4jOnNonType.java | 2 +- .../resource/after-ecj/LoggerSlf4jTypes.java | 10 +-- .../resource/after-ecj/LoggerSlf4jWithClass.java | 8 +-- .../resource/after-ecj/LoggerSlf4jWithPackage.java | 4 +- test/transform/resource/before/LoggerCommons.java | 6 +- test/transform/resource/before/LoggerJul.java | 6 +- test/transform/resource/before/LoggerLog4j.java | 6 +- test/transform/resource/before/LoggerSlf4j.java | 4 +- .../resource/before/LoggerSlf4jAlreadyExists.java | 2 +- .../resource/before/LoggerSlf4jClassOfArray.java | 2 +- .../resource/before/LoggerSlf4jOnNonType.java | 2 +- .../resource/before/LoggerSlf4jTypes.java | 10 +-- .../resource/before/LoggerSlf4jWithClass.java | 8 +-- .../resource/before/LoggerSlf4jWithPackage.java | 4 +- usage_examples/LogExample_pre.jpage | 2 +- website/features/Log.html | 16 ++--- 34 files changed, 402 insertions(+), 231 deletions(-) delete mode 100644 src/core/lombok/commons/Log.java create mode 100644 src/core/lombok/extern/apachecommons/Log.java create mode 100644 src/core/lombok/extern/jul/Log.java create mode 100644 src/core/lombok/extern/log4j/Log.java create mode 100644 src/core/lombok/extern/slf4j/Log.java delete mode 100644 src/core/lombok/jul/Log.java delete mode 100644 src/core/lombok/log4j/Log.java delete mode 100644 src/core/lombok/slf4j/Log.java (limited to 'website') diff --git a/buildScripts/website.ant.xml b/buildScripts/website.ant.xml index 6ab8d509..08fc8a55 100644 --- a/buildScripts/website.ant.xml +++ b/buildScripts/website.ant.xml @@ -1,5 +1,5 @@