Skip to content

Commit aa74f9d

Browse files
authored
Merge pull request #89 from komsa-ag/Feature/ExtensionPoints
2 parents 692eee8 + 6bd138a commit aa74f9d

File tree

2 files changed

+18
-9
lines changed

2 files changed

+18
-9
lines changed

src/log4net/Core/LoggingEvent.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -680,6 +680,7 @@ public LocationInfo LocationInformation
680680
public object MessageObject
681681
{
682682
get { return m_message; }
683+
protected set { m_message = value; }
683684
}
684685

685686
/// <summary>
@@ -743,7 +744,7 @@ internal void EnsureRepository(ILoggerRepository repository)
743744
/// The collected information is cached for future use.
744745
/// </para>
745746
/// </remarks>
746-
public string RenderedMessage
747+
public virtual string RenderedMessage
747748
{
748749
get
749750
{
@@ -785,7 +786,7 @@ public string RenderedMessage
785786
/// to be accessed multiple times then the property will be more efficient.
786787
/// </para>
787788
/// </remarks>
788-
public void WriteRenderedMessage(TextWriter writer)
789+
public virtual void WriteRenderedMessage(TextWriter writer)
789790
{
790791
if (m_data.Message != null)
791792
{
@@ -1357,7 +1358,7 @@ public void FixVolatileData(bool fastButLoose)
13571358
/// It is not possible to 'unfix' a field.
13581359
/// </para>
13591360
/// </remarks>
1360-
protected void FixVolatileData(FixFlags flags)
1361+
protected virtual void FixVolatileData(FixFlags flags)
13611362
{
13621363
object forceCreation = null;
13631364

@@ -1641,7 +1642,7 @@ public PropertiesDictionary GetProperties()
16411642
/// <summary>
16421643
/// The application supplied message of logging event.
16431644
/// </summary>
1644-
private readonly object m_message;
1645+
private object m_message;
16451646

16461647
/// <summary>
16471648
/// The exception that was thrown.

src/log4net/Util/SystemStringFormat.cs

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,16 @@ namespace log4net.Util
3636
public sealed class SystemStringFormat
3737
{
3838
private readonly IFormatProvider m_provider;
39-
private readonly string m_format;
40-
private readonly object[] m_args;
39+
40+
/// <summary>
41+
/// Format
42+
/// </summary>
43+
public string Format { get; set; }
44+
45+
/// <summary>
46+
/// Args
47+
/// </summary>
48+
public object[] Args { get; set; }
4149

4250
#region Constructor
4351

@@ -50,8 +58,8 @@ public sealed class SystemStringFormat
5058
public SystemStringFormat(IFormatProvider provider, string format, params object[] args)
5159
{
5260
m_provider = provider;
53-
m_format = format;
54-
m_args = args;
61+
Format = format;
62+
Args = args;
5563
}
5664

5765
#endregion Constructor
@@ -62,7 +70,7 @@ public SystemStringFormat(IFormatProvider provider, string format, params object
6270
/// <returns>the formatted string</returns>
6371
public override string ToString()
6472
{
65-
return StringFormat(m_provider, m_format, m_args);
73+
return StringFormat(m_provider, Format, Args);
6674
}
6775

6876
#region StringFormat

0 commit comments

Comments
 (0)