Skip to content

Commit

Permalink
Merge pull request #89 from komsa-ag/Feature/ExtensionPoints
Browse files Browse the repository at this point in the history
  • Loading branch information
fluffynuts committed Jul 22, 2022
2 parents 692eee8 + 6bd138a commit aa74f9d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 9 deletions.
9 changes: 5 additions & 4 deletions src/log4net/Core/LoggingEvent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -680,6 +680,7 @@ public LocationInfo LocationInformation
public object MessageObject
{
get { return m_message; }
protected set { m_message = value; }
}

/// <summary>
Expand Down Expand Up @@ -743,7 +744,7 @@ internal void EnsureRepository(ILoggerRepository repository)
/// The collected information is cached for future use.
/// </para>
/// </remarks>
public string RenderedMessage
public virtual string RenderedMessage
{
get
{
Expand Down Expand Up @@ -785,7 +786,7 @@ public string RenderedMessage
/// to be accessed multiple times then the property will be more efficient.
/// </para>
/// </remarks>
public void WriteRenderedMessage(TextWriter writer)
public virtual void WriteRenderedMessage(TextWriter writer)
{
if (m_data.Message != null)
{
Expand Down Expand Up @@ -1357,7 +1358,7 @@ public void FixVolatileData(bool fastButLoose)
/// It is not possible to 'unfix' a field.
/// </para>
/// </remarks>
protected void FixVolatileData(FixFlags flags)
protected virtual void FixVolatileData(FixFlags flags)
{
object forceCreation = null;

Expand Down Expand Up @@ -1641,7 +1642,7 @@ public PropertiesDictionary GetProperties()
/// <summary>
/// The application supplied message of logging event.
/// </summary>
private readonly object m_message;
private object m_message;

/// <summary>
/// The exception that was thrown.
Expand Down
18 changes: 13 additions & 5 deletions src/log4net/Util/SystemStringFormat.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,16 @@ namespace log4net.Util
public sealed class SystemStringFormat
{
private readonly IFormatProvider m_provider;
private readonly string m_format;
private readonly object[] m_args;

/// <summary>
/// Format
/// </summary>
public string Format { get; set; }

/// <summary>
/// Args
/// </summary>
public object[] Args { get; set; }

#region Constructor

Expand All @@ -50,8 +58,8 @@ public sealed class SystemStringFormat
public SystemStringFormat(IFormatProvider provider, string format, params object[] args)
{
m_provider = provider;
m_format = format;
m_args = args;
Format = format;
Args = args;
}

#endregion Constructor
Expand All @@ -62,7 +70,7 @@ public SystemStringFormat(IFormatProvider provider, string format, params object
/// <returns>the formatted string</returns>
public override string ToString()
{
return StringFormat(m_provider, m_format, m_args);
return StringFormat(m_provider, Format, Args);
}

#region StringFormat
Expand Down

0 comments on commit aa74f9d

Please sign in to comment.