You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4net-dev@logging.apache.org by ni...@apache.org on 2004/05/30 13:08:56 UTC
cvs commit: logging-log4net/src/Layout/Pattern DatePatternConverter.cs NamedPatternConverter.cs NewLinePatternConverter.cs
nicko 2004/05/30 04:08:56
Modified: src/Layout/Pattern DatePatternConverter.cs
NamedPatternConverter.cs NewLinePatternConverter.cs
Log:
Updated doc comments
Revision Changes Path
1.4 +16 -1 logging-log4net/src/Layout/Pattern/DatePatternConverter.cs
Index: DatePatternConverter.cs
===================================================================
RCS file: /home/cvs/logging-log4net/src/Layout/Pattern/DatePatternConverter.cs,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- DatePatternConverter.cs 23 Feb 2004 03:18:04 -0000 1.3
+++ DatePatternConverter.cs 30 May 2004 11:08:56 -0000 1.4
@@ -36,6 +36,22 @@
#region Implementation of IOptionHandler
+ /// <summary>
+ /// Initialize the converter pattern based on the <see cref="PatternConverter.Option"/> property.
+ /// </summary>
+ /// <remarks>
+ /// <para>
+ /// This is part of the <see cref="IOptionHandler"/> delayed object
+ /// activation scheme. The <see cref="ActivateOptions"/> method must
+ /// be called on this object after the configuration properties have
+ /// been set. Until <see cref="ActivateOptions"/> is called this
+ /// object is in an undefined state and must not be used.
+ /// </para>
+ /// <para>
+ /// If any of the configuration properties are modified then
+ /// <see cref="ActivateOptions"/> must be called again.
+ /// </para>
+ /// </remarks>
public void ActivateOptions()
{
string dateFormatStr = Option;
@@ -77,7 +93,6 @@
/// </summary>
/// <param name="writer"><see cref="TextWriter" /> that will receive the formatted result.</param>
/// <param name="loggingEvent">the event being logged</param>
- /// <returns></returns>
override protected void Convert(TextWriter writer, LoggingEvent loggingEvent)
{
try
1.3 +25 -10 logging-log4net/src/Layout/Pattern/NamedPatternConverter.cs
Index: NamedPatternConverter.cs
===================================================================
RCS file: /home/cvs/logging-log4net/src/Layout/Pattern/NamedPatternConverter.cs,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- NamedPatternConverter.cs 16 Feb 2004 02:10:53 -0000 1.2
+++ NamedPatternConverter.cs 30 May 2004 11:08:56 -0000 1.3
@@ -36,6 +36,22 @@
#region Implementation of IOptionHandler
+ /// <summary>
+ /// Initialise the converter
+ /// </summary>
+ /// <remarks>
+ /// <para>
+ /// This is part of the <see cref="IOptionHandler"/> delayed object
+ /// activation scheme. The <see cref="ActivateOptions"/> method must
+ /// be called on this object after the configuration properties have
+ /// been set. Until <see cref="ActivateOptions"/> is called this
+ /// object is in an undefined state and must not be used.
+ /// </para>
+ /// <para>
+ /// If any of the configuration properties are modified then
+ /// <see cref="ActivateOptions"/> must be called again.
+ /// </para>
+ /// </remarks>
public void ActivateOptions()
{
if (Option == null)
@@ -84,32 +100,31 @@
/// </summary>
/// <param name="writer"><see cref="TextWriter" /> that will receive the formatted result.</param>
/// <param name="loggingEvent">the event being logged</param>
- /// <returns>the precision of the fully qualified name specified</returns>
override protected void Convert(TextWriter writer, LoggingEvent loggingEvent)
{
- string n = GetFullyQualifiedName(loggingEvent);
+ string name = GetFullyQualifiedName(loggingEvent);
if (m_precision <= 0)
{
- writer.Write( n );
+ writer.Write(name);
}
else
{
- int len = n.Length;
+ int len = name.Length;
// We subtract 1 from 'len' when assigning to 'end' to avoid out of
- // bounds exception in return r.substring(end+1, len). This can happen if
+ // bounds exception in return name.Substring(end+1, len). This can happen if
// precision is 1 and the logger name ends with a dot.
- int end = len -1 ;
- for(int i = m_precision; i > 0; i--)
+ int end = len - 1;
+ for(int i=m_precision; i>0; i--)
{
- end = n.LastIndexOf('.', end-1);
+ end = name.LastIndexOf('.', end-1);
if (end == -1)
{
- writer.Write( n );
+ writer.Write(name);
return;
}
}
- writer.Write( n.Substring(end+1, len-end-1) );
+ writer.Write(name.Substring(end+1, len-end-1));
}
}
}
1.3 +16 -0 logging-log4net/src/Layout/Pattern/NewLinePatternConverter.cs
Index: NewLinePatternConverter.cs
===================================================================
RCS file: /home/cvs/logging-log4net/src/Layout/Pattern/NewLinePatternConverter.cs,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- NewLinePatternConverter.cs 16 Feb 2004 02:10:53 -0000 1.2
+++ NewLinePatternConverter.cs 30 May 2004 11:08:56 -0000 1.3
@@ -33,6 +33,22 @@
{
#region Implementation of IOptionHandler
+ /// <summary>
+ /// Initialise the converter
+ /// </summary>
+ /// <remarks>
+ /// <para>
+ /// This is part of the <see cref="IOptionHandler"/> delayed object
+ /// activation scheme. The <see cref="ActivateOptions"/> method must
+ /// be called on this object after the configuration properties have
+ /// been set. Until <see cref="ActivateOptions"/> is called this
+ /// object is in an undefined state and must not be used.
+ /// </para>
+ /// <para>
+ /// If any of the configuration properties are modified then
+ /// <see cref="ActivateOptions"/> must be called again.
+ /// </para>
+ /// </remarks>
public void ActivateOptions()
{
if (string.Compare(Option, "DOS", true, System.Globalization.CultureInfo.InvariantCulture) == 0)