logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1514950 - in /logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core: appender/rewrite/ appender/rolling/ appender/routing/ async/ config/ pattern/
Date Sat, 17 Aug 2013 05:35:33 GMT
Author: ggregory
Date: Sat Aug 17 05:35:32 2013
New Revision: 1514950

URL: http://svn.apache.org/r1514950
Log:
Better API name: StrSubstitutor getSubs -> StrSubstitutor getStrSubstitutor

Modified:
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/rewrite/PropertiesRewritePolicy.java
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/rolling/DefaultRolloverStrategy.java
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/routing/RoutingAppender.java
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/async/AsyncLogger.java
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/BaseConfiguration.java
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/Configuration.java
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/JSONConfiguration.java
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/LoggerConfig.java
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/XMLConfiguration.java
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/LiteralPatternConverter.java
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/MessagePatternConverter.java

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/rewrite/PropertiesRewritePolicy.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/rewrite/PropertiesRewritePolicy.java?rev=1514950&r1=1514949&r2=1514950&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/rewrite/PropertiesRewritePolicy.java
(original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/rewrite/PropertiesRewritePolicy.java
Sat Aug 17 05:35:32 2013
@@ -67,7 +67,7 @@ public final class PropertiesRewritePoli
         for (final Map.Entry<Property, Boolean> entry : properties.entrySet()) {
             final Property prop = entry.getKey();
             props.put(prop.getName(), entry.getValue() ?
-                config.getSubst().replace(prop.getValue()) : prop.getValue());
+                config.getStrSubstitutor().replace(prop.getValue()) : prop.getValue());
         }
 
         return new Log4jLogEvent(source.getLoggerName(), source.getMarker(), source.getFQCN(),
source.getLevel(),

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/rolling/DefaultRolloverStrategy.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/rolling/DefaultRolloverStrategy.java?rev=1514950&r1=1514949&r2=1514950&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/rolling/DefaultRolloverStrategy.java
(original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/rolling/DefaultRolloverStrategy.java
Sat Aug 17 05:35:32 2013
@@ -386,7 +386,7 @@ public class DefaultRolloverStrategy imp
         } else {
             maxIndex = DEFAULT_WINDOW_SIZE;
         }
-        return new DefaultRolloverStrategy(minIndex, maxIndex, useMax, config.getSubst());
+        return new DefaultRolloverStrategy(minIndex, maxIndex, useMax, config.getStrSubstitutor());
     }
 
 }

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/routing/RoutingAppender.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/routing/RoutingAppender.java?rev=1514950&r1=1514949&r2=1514950&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/routing/RoutingAppender.java
(original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/routing/RoutingAppender.java
Sat Aug 17 05:35:32 2013
@@ -108,7 +108,7 @@ public final class RoutingAppender exten
         if (rewritePolicy != null) {
             event = rewritePolicy.rewrite(event);
         }
-        final String key = config.getSubst().replace(event, routes.getPattern());
+        final String key = config.getStrSubstitutor().replace(event, routes.getPattern());
         final AppenderControl control = getControl(key, event);
         if (control != null) {
             control.callAppender(event);

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/async/AsyncLogger.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/async/AsyncLogger.java?rev=1514950&r1=1514949&r2=1514950&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/async/AsyncLogger.java
(original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/async/AsyncLogger.java
Sat Aug 17 05:35:32 2013
@@ -236,7 +236,7 @@ public class AsyncLogger extends Logger 
     public void actualAsyncLog(final RingBufferLogEvent event) {
         final Map<Property, Boolean> properties = config.loggerConfig.getProperties();
         event.mergePropertiesIntoContextMap(properties,
-                config.config.getSubst());
+                config.config.getStrSubstitutor());
         config.logEvent(event);
     }
 

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/BaseConfiguration.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/BaseConfiguration.java?rev=1514950&r1=1514949&r2=1514950&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/BaseConfiguration.java
(original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/BaseConfiguration.java
Sat Aug 17 05:35:32 2013
@@ -336,7 +336,7 @@ public class BaseConfiguration extends A
     }
 
     @Override
-    public StrSubstitutor getSubst() {
+    public StrSubstitutor getStrSubstitutor() {
         return subst;
     }
 

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/Configuration.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/Configuration.java?rev=1514950&r1=1514949&r2=1514950&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/Configuration.java
(original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/Configuration.java
Sat Aug 17 05:35:32 2013
@@ -72,7 +72,7 @@ public interface Configuration extends F
 
     void removeListener(ConfigurationListener listener);
 
-    StrSubstitutor getSubst();
+    StrSubstitutor getStrSubstitutor();
 
     void createConfiguration(Node node, LogEvent event);
 

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/JSONConfiguration.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/JSONConfiguration.java?rev=1514950&r1=1514949&r2=1514950&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/JSONConfiguration.java
(original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/JSONConfiguration.java
Sat Aug 17 05:35:32 2013
@@ -90,7 +90,7 @@ public class JSONConfiguration extends B
             PrintStream stream = System.out;
             for (final Map.Entry<String, String> entry : rootNode.getAttributes().entrySet())
{
                 if ("status".equalsIgnoreCase(entry.getKey())) {
-                    status = Level.toLevel(getSubst().replace(entry.getValue()), null);
+                    status = Level.toLevel(getStrSubstitutor().replace(entry.getValue()),
null);
                     if (status == null) {
                         status = Level.ERROR;
                         messages.add("Invalid status specified: " + entry.getValue() + ".
Defaulting to ERROR");
@@ -111,24 +111,24 @@ public class JSONConfiguration extends B
                         }
                     }
                 } else if ("shutdownHook".equalsIgnoreCase(entry.getKey())) {
-                    String hook = getSubst().replace(entry.getValue());
+                    String hook = getStrSubstitutor().replace(entry.getValue());
                     isShutdownHookEnabled = !hook.equalsIgnoreCase("disable");
                 } else if ("verbose".equalsIgnoreCase(entry.getKey())) {
-                    verbose = Boolean.parseBoolean(getSubst().replace(entry.getValue()));
+                    verbose = Boolean.parseBoolean(getStrSubstitutor().replace(entry.getValue()));
                 } else if ("packages".equalsIgnoreCase(entry.getKey())) {
-                    final String[] packages = getSubst().replace(entry.getValue()).split(",");
+                    final String[] packages = getStrSubstitutor().replace(entry.getValue()).split(",");
                     for (final String p : packages) {
                         PluginManager.addPackage(p);
                     }
                 } else if ("name".equalsIgnoreCase(entry.getKey())) {
-                    setName(getSubst().replace(entry.getValue()));
+                    setName(getStrSubstitutor().replace(entry.getValue()));
                 } else if ("monitorInterval".equalsIgnoreCase(entry.getKey())) {
-                    final int interval = Integer.parseInt(getSubst().replace(entry.getValue()));
+                    final int interval = Integer.parseInt(getStrSubstitutor().replace(entry.getValue()));
                     if (interval > 0 && configFile != null) {
                         monitor = new FileConfigurationMonitor(this, configFile, listeners,
interval);
                     }
                 } else if ("advertiser".equalsIgnoreCase(entry.getKey())) {
-                    final String advertiserString = getSubst().replace(entry.getValue());
+                    final String advertiserString = getStrSubstitutor().replace(entry.getValue());
                     if (advertiserString != null)
                     {
                         @SuppressWarnings("unchecked")

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/LoggerConfig.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/LoggerConfig.java?rev=1514950&r1=1514949&r2=1514950&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/LoggerConfig.java
(original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/LoggerConfig.java
Sat Aug 17 05:35:32 2013
@@ -328,7 +328,7 @@ public class LoggerConfig extends Abstra
      *
      * @return an unmodifiable map with the configuration properties, or
      *         {@code null}
-     * @see Configuration#getSubst()
+     * @see Configuration#getStrSubstitutor()
      * @see StrSubstitutor
      */
     // LOG4J2-157
@@ -357,7 +357,7 @@ public class LoggerConfig extends Abstra
             for (final Map.Entry<Property, Boolean> entry : properties
                     .entrySet()) {
                 final Property prop = entry.getKey();
-                final String value = entry.getValue() ? config.getSubst()
+                final String value = entry.getValue() ? config.getStrSubstitutor()
                         .replace(prop.getValue()) : prop.getValue();
                 props.add(Property.createProperty(prop.getName(), value));
             }

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/XMLConfiguration.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/XMLConfiguration.java?rev=1514950&r1=1514949&r2=1514950&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/XMLConfiguration.java
(original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/XMLConfiguration.java
Sat Aug 17 05:35:32 2013
@@ -158,14 +158,14 @@ public class XMLConfiguration extends Ba
 
             for (final Map.Entry<String, String> entry : attrs.entrySet()) {
                 if ("status".equalsIgnoreCase(entry.getKey())) {
-                    final Level stat = Level.toLevel(getSubst().replace(entry.getValue()),
null);
+                    final Level stat = Level.toLevel(getStrSubstitutor().replace(entry.getValue()),
null);
                     if (stat != null) {
                         status = stat;
                     } else {
                         messages.add("Invalid status specified: " + entry.getValue() + ".
Defaulting to " + status);
                     }
                 } else if ("dest".equalsIgnoreCase(entry.getKey())) {
-                    final String dest = getSubst().replace(entry.getValue());
+                    final String dest = getStrSubstitutor().replace(entry.getValue());
                     if (dest != null) {
                         if (dest.equalsIgnoreCase("err")) {
                             stream = System.err;
@@ -180,28 +180,28 @@ public class XMLConfiguration extends Ba
                         }
                     }
                 } else if ("shutdownHook".equalsIgnoreCase(entry.getKey())) {
-                    String hook = getSubst().replace(entry.getValue());
+                    String hook = getStrSubstitutor().replace(entry.getValue());
                     isShutdownHookEnabled = !hook.equalsIgnoreCase("disable");
                 } else if ("verbose".equalsIgnoreCase(entry.getKey())) {
-                    verbose = Boolean.parseBoolean(getSubst().replace(entry.getValue()));
-                } else if ("packages".equalsIgnoreCase(getSubst().replace(entry.getKey())))
{
+                    verbose = Boolean.parseBoolean(getStrSubstitutor().replace(entry.getValue()));
+                } else if ("packages".equalsIgnoreCase(getStrSubstitutor().replace(entry.getKey())))
{
                     final String[] packages = entry.getValue().split(",");
                     for (final String p : packages) {
                         PluginManager.addPackage(p);
                     }
                 } else if ("name".equalsIgnoreCase(entry.getKey())) {
-                    setName(getSubst().replace(entry.getValue()));
+                    setName(getStrSubstitutor().replace(entry.getValue()));
                 } else if ("strict".equalsIgnoreCase(entry.getKey())) {
-                    strict = Boolean.parseBoolean(getSubst().replace(entry.getValue()));
+                    strict = Boolean.parseBoolean(getStrSubstitutor().replace(entry.getValue()));
                 } else if ("schema".equalsIgnoreCase(entry.getKey())) {
-                    schema = getSubst().replace(entry.getValue());
+                    schema = getStrSubstitutor().replace(entry.getValue());
                 } else if ("monitorInterval".equalsIgnoreCase(entry.getKey())) {
-                    final int interval = Integer.parseInt(getSubst().replace(entry.getValue()));
+                    final int interval = Integer.parseInt(getStrSubstitutor().replace(entry.getValue()));
                     if (interval > 0 && configFile != null) {
                         monitor = new FileConfigurationMonitor(this, configFile, listeners,
interval);
                     }
                 } else if ("advertiser".equalsIgnoreCase(entry.getKey())) {
-                    final String advertiserString = getSubst().replace(entry.getValue());
+                    final String advertiserString = getStrSubstitutor().replace(entry.getValue());
                     if (advertiserString != null)
                     {
                         @SuppressWarnings("unchecked")

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/LiteralPatternConverter.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/LiteralPatternConverter.java?rev=1514950&r1=1514949&r2=1514950&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/LiteralPatternConverter.java
(original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/LiteralPatternConverter.java
Sat Aug 17 05:35:32 2013
@@ -51,14 +51,14 @@ public final class LiteralPatternConvert
      */
     @Override
     public void format(final LogEvent event, final StringBuilder toAppendTo) {
-        toAppendTo.append(substitute ? config.getSubst().replace(event, literal) : literal);
+        toAppendTo.append(substitute ? config.getStrSubstitutor().replace(event, literal)
: literal);
     }
     /**
      * {@inheritDoc}
      */
     @Override
     public void format(final Object obj, final StringBuilder output) {
-        output.append(substitute ? config.getSubst().replace(literal) : literal);
+        output.append(substitute ? config.getStrSubstitutor().replace(literal) : literal);
     }
 
     /**
@@ -66,7 +66,7 @@ public final class LiteralPatternConvert
      */
     @Override
     public void format(final StringBuilder output, final Object... objects) {
-        output.append(substitute ? config.getSubst().replace(literal) : literal);
+        output.append(substitute ? config.getStrSubstitutor().replace(literal) : literal);
     }
 
     public String getLiteral() {

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/MessagePatternConverter.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/MessagePatternConverter.java?rev=1514950&r1=1514949&r2=1514950&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/MessagePatternConverter.java
(original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/MessagePatternConverter.java
Sat Aug 17 05:35:32 2013
@@ -69,7 +69,7 @@ public final class MessagePatternConvert
             }
             if (result != null) {
                 toAppendTo.append(config != null && result.contains("${") ?
-                    config.getSubst().replace(event, result) : result);
+                    config.getStrSubstitutor().replace(event, result) : result);
             } else {
                 toAppendTo.append("null");
             }



Mime
View raw message