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