You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by mi...@apache.org on 2015/10/30 13:14:30 UTC
[13/16] logging-log4j2 git commit: Javadoc clean ups.
Javadoc clean ups.
Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/a792e158
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/a792e158
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/a792e158
Branch: refs/heads/LOG4J-1181
Commit: a792e15873e6298d449958741759ae3082c9de92
Parents: 5ae1560
Author: ggregory <gg...@apache.org>
Authored: Thu Oct 29 21:08:23 2015 -0700
Committer: ggregory <gg...@apache.org>
Committed: Thu Oct 29 21:08:23 2015 -0700
----------------------------------------------------------------------
.../org/apache/logging/log4j/core/Logger.java | 21 +++++++++++++-------
1 file changed, 14 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/a792e158/log4j-core/src/main/java/org/apache/logging/log4j/core/Logger.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/Logger.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/Logger.java
index 51b3e39..2b3ee3e 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/Logger.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/Logger.java
@@ -274,14 +274,21 @@ public class Logger extends AbstractLogger implements Supplier<LoggerConfig> {
}
/**
- * Associates the Logger with a new Configuration. This method is not exposed through the public API.
- *
- * There are two ways that could be used to guarantee all threads are aware of changes to config. 1. synchronize
- * this method. Accessors don't need to be synchronized as Java will treat all variables within a synchronized block
- * as volatile. 2. Declare the variable volatile. Option 2 is used here as the performance cost is very low and it
- * does a better job at documenting how it is used.
+ * Associates this Logger with a new Configuration. This method is not
+ * exposed through the public API.
+ * <p>
+ * There are two ways this could be used to guarantee all threads are aware
+ * of changes to config.
+ * <ol>
+ * <li>Synchronize this method. Accessors don't need to be synchronized as
+ * Java will treat all variables within a synchronized block as volatile.
+ * </li>
+ * <li>Declare the variable volatile. Option 2 is used here as the
+ * performance cost is very low and it does a better job at documenting how
+ * it is used.</li>
*
- * @param newConfig The new Configuration.
+ * @param newConfig
+ * The new Configuration.
*/
protected void updateConfiguration(final Configuration newConfig) {
this.privateConfig = new PrivateConfig(newConfig, this);