logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From grobme...@apache.org
Subject svn commit: r1481781 - /logging/log4j/trunk/src/main/java/org/apache/log4j/EnhancedPatternLayout.java
Date Mon, 13 May 2013 10:33:33 GMT
Author: grobmeier
Date: Mon May 13 10:33:32 2013
New Revision: 1481781

URL: http://svn.apache.org/r1481781
Log:
added some docs only present in extras

Modified:
    logging/log4j/trunk/src/main/java/org/apache/log4j/EnhancedPatternLayout.java

Modified: logging/log4j/trunk/src/main/java/org/apache/log4j/EnhancedPatternLayout.java
URL: http://svn.apache.org/viewvc/logging/log4j/trunk/src/main/java/org/apache/log4j/EnhancedPatternLayout.java?rev=1481781&r1=1481780&r2=1481781&view=diff
==============================================================================
--- logging/log4j/trunk/src/main/java/org/apache/log4j/EnhancedPatternLayout.java (original)
+++ logging/log4j/trunk/src/main/java/org/apache/log4j/EnhancedPatternLayout.java Mon May
13 10:33:32 2013
@@ -309,13 +309,15 @@ import org.apache.log4j.spi.LoggingEvent
 
    <p>By default the relevant information is output as is. However,
    with the aid of format modifiers it is possible to change the
-   minimum field width, the maximum field width and justification.
+   minimum field width, the maximum field width, justification
+   and truncation.
 
-   <p>The optional format modifier is placed between the percent sign
+   <p>The optional format modifier are placed between the percent sign
    and the conversion character.
 
-   <p>The first optional format modifier is the <em>left justification
-   flag</em> which is just the minus (-) character. Then comes the
+   <p>The <em>left justification flag</em>, the minus sign (-),
+   the <em>right truncation flag</em>, the exclamation mark (!),
+   or any combination appear first.  Followed by the
    optional <em>minimum field width</em> modifier. This is a decimal
    constant that represents the minimum number of characters to
    output. If the data item requires fewer characters, it is padded on
@@ -334,7 +336,8 @@ import org.apache.log4j.spi.LoggingEvent
    example, it the maximum field width is eight and the data item is
    ten characters long, then the first two characters of the data item
    are dropped. This behavior deviates from the printf function in C
-   where truncation is done from the end.
+   where truncation is done from the end. The <em>right truncation flag</em>,
+   described previously, will override this behavior.
 
    <p>Below are various format modifier examples for the category
    conversion specifier.
@@ -370,6 +373,15 @@ import org.apache.log4j.spi.LoggingEvent
    characters.
 
    <tr>
+   <td align=center>%!.30c</td>
+   <td align=center>NA</td>
+   <td align=center>none</td>
+   <td align=center>30</td>
+
+   <td>Truncate from the end if the category name is longer than 30
+   characters.
+
+   <tr>
    <td align=center>%20.30c</td>
    <td align=center>false</td>
    <td align=center>20</td>



Mime
View raw message