From d78135180c8f9e9f4c6c361679759d3eacb63be3 Mon Sep 17 00:00:00 2001
From: Reinier Zwitserloot private static final org.slf4j.ext.XLogger log = org.slf4j.ext.XLoggerFactory.getXLogger(LogExample.class);
- By default, the category (or name) of the logger will be the type where the annotation was placed. This can be customised by specifying a value for the category.
+ By default, the topic (or name) of the logger will be the class name of the class annotated with the @Log
annotation. This can be customised by specifying the topic
parameter. For example: @XSlf4j(topic="reporting")
.
If a field called log
already exists, a warning will be emitted and no code will be generated.
- 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.
+ 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.