|
|
|
@ -9,11 +9,13 @@ namespace Avalonia.Logging |
|
|
|
{ |
|
|
|
private readonly ILogSink _sink; |
|
|
|
private readonly LogEventLevel _level; |
|
|
|
private readonly string _area; |
|
|
|
|
|
|
|
public ParametrizedLogger(ILogSink sink, LogEventLevel level) |
|
|
|
public ParametrizedLogger(ILogSink sink, LogEventLevel level, string area) |
|
|
|
{ |
|
|
|
_sink = sink; |
|
|
|
_level = level; |
|
|
|
_area = area; |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
@ -24,58 +26,51 @@ namespace Avalonia.Logging |
|
|
|
/// <summary>
|
|
|
|
/// Logs an event.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="area">The area that the event originates.</param>
|
|
|
|
/// <param name="source">The object from which the event originates.</param>
|
|
|
|
/// <param name="messageTemplate">The message template.</param>
|
|
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)] |
|
|
|
public void Log( |
|
|
|
string area, |
|
|
|
object source, |
|
|
|
string messageTemplate) |
|
|
|
{ |
|
|
|
_sink.Log(_level, area, source, messageTemplate); |
|
|
|
_sink.Log(_level, _area, source, messageTemplate); |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Logs an event.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="area">The area that the event originates.</param>
|
|
|
|
/// <param name="source">The object from which the event originates.</param>
|
|
|
|
/// <param name="messageTemplate">The message template.</param>
|
|
|
|
/// <param name="propertyValue0">Message property value.</param>
|
|
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)] |
|
|
|
public void Log<T0>( |
|
|
|
string area, |
|
|
|
object source, |
|
|
|
string messageTemplate, |
|
|
|
T0 propertyValue0) |
|
|
|
{ |
|
|
|
_sink.Log(_level, area, source, messageTemplate, propertyValue0); |
|
|
|
_sink.Log(_level, _area, source, messageTemplate, propertyValue0); |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Logs an event.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="area">The area that the event originates.</param>
|
|
|
|
/// <param name="source">The object from which the event originates.</param>
|
|
|
|
/// <param name="messageTemplate">The message template.</param>
|
|
|
|
/// <param name="propertyValue0">Message property value.</param>
|
|
|
|
/// <param name="propertyValue1">Message property value.</param>
|
|
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)] |
|
|
|
public void Log<T0, T1>( |
|
|
|
string area, |
|
|
|
object source, |
|
|
|
string messageTemplate, |
|
|
|
T0 propertyValue0, |
|
|
|
T1 propertyValue1) |
|
|
|
{ |
|
|
|
_sink.Log(_level, area, source, messageTemplate, propertyValue0, propertyValue1); |
|
|
|
_sink.Log(_level, _area, source, messageTemplate, propertyValue0, propertyValue1); |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Logs an event.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="area">The area that the event originates.</param>
|
|
|
|
/// <param name="source">The object from which the event originates.</param>
|
|
|
|
/// <param name="messageTemplate">The message template.</param>
|
|
|
|
/// <param name="propertyValue0">Message property value.</param>
|
|
|
|
@ -83,20 +78,18 @@ namespace Avalonia.Logging |
|
|
|
/// <param name="propertyValue2">Message property value.</param>
|
|
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)] |
|
|
|
public void Log<T0, T1, T2>( |
|
|
|
string area, |
|
|
|
object source, |
|
|
|
string messageTemplate, |
|
|
|
T0 propertyValue0, |
|
|
|
T1 propertyValue1, |
|
|
|
T2 propertyValue2) |
|
|
|
{ |
|
|
|
_sink.Log(_level, area, source, messageTemplate, propertyValue0, propertyValue1, propertyValue2); |
|
|
|
_sink.Log(_level, _area, source, messageTemplate, propertyValue0, propertyValue1, propertyValue2); |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Logs an event.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="area">The area that the event originates.</param>
|
|
|
|
/// <param name="source">The object from which the event originates.</param>
|
|
|
|
/// <param name="messageTemplate">The message template.</param>
|
|
|
|
/// <param name="propertyValue0">Message property value.</param>
|
|
|
|
@ -105,7 +98,6 @@ namespace Avalonia.Logging |
|
|
|
/// <param name="propertyValue3">Message property value.</param>
|
|
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)] |
|
|
|
public void Log<T0, T1, T2, T3>( |
|
|
|
string area, |
|
|
|
object source, |
|
|
|
string messageTemplate, |
|
|
|
T0 propertyValue0, |
|
|
|
@ -113,13 +105,12 @@ namespace Avalonia.Logging |
|
|
|
T2 propertyValue2, |
|
|
|
T3 propertyValue3) |
|
|
|
{ |
|
|
|
_sink.Log(_level, area, source, messageTemplate, propertyValue0, propertyValue1, propertyValue2, propertyValue3); |
|
|
|
_sink.Log(_level, _area, source, messageTemplate, propertyValue0, propertyValue1, propertyValue2, propertyValue3); |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Logs an event.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="area">The area that the event originates.</param>
|
|
|
|
/// <param name="source">The object from which the event originates.</param>
|
|
|
|
/// <param name="messageTemplate">The message template.</param>
|
|
|
|
/// <param name="propertyValue0">Message property value.</param>
|
|
|
|
@ -129,7 +120,6 @@ namespace Avalonia.Logging |
|
|
|
/// <param name="propertyValue4">Message property value.</param>
|
|
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)] |
|
|
|
public void Log<T0, T1, T2, T3, T4>( |
|
|
|
string area, |
|
|
|
object source, |
|
|
|
string messageTemplate, |
|
|
|
T0 propertyValue0, |
|
|
|
@ -138,13 +128,12 @@ namespace Avalonia.Logging |
|
|
|
T3 propertyValue3, |
|
|
|
T4 propertyValue4) |
|
|
|
{ |
|
|
|
_sink.Log(_level, area, source, messageTemplate, propertyValue0, propertyValue1, propertyValue2, propertyValue3, propertyValue4); |
|
|
|
_sink.Log(_level, _area, source, messageTemplate, propertyValue0, propertyValue1, propertyValue2, propertyValue3, propertyValue4); |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Logs an event.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="area">The area that the event originates.</param>
|
|
|
|
/// <param name="source">The object from which the event originates.</param>
|
|
|
|
/// <param name="messageTemplate">The message template.</param>
|
|
|
|
/// <param name="propertyValue0">Message property value.</param>
|
|
|
|
@ -155,7 +144,6 @@ namespace Avalonia.Logging |
|
|
|
/// <param name="propertyValue5">Message property value.</param>
|
|
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)] |
|
|
|
public void Log<T0, T1, T2, T3, T4, T5>( |
|
|
|
string area, |
|
|
|
object source, |
|
|
|
string messageTemplate, |
|
|
|
T0 propertyValue0, |
|
|
|
@ -165,7 +153,7 @@ namespace Avalonia.Logging |
|
|
|
T4 propertyValue4, |
|
|
|
T5 propertyValue5) |
|
|
|
{ |
|
|
|
_sink.Log(_level, area, source, messageTemplate, propertyValue0, propertyValue1, propertyValue2, propertyValue3, propertyValue4, propertyValue5); |
|
|
|
_sink.Log(_level, _area, source, messageTemplate, propertyValue0, propertyValue1, propertyValue2, propertyValue3, propertyValue4, propertyValue5); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|