=== Summary: 675 files | 7 generated | 484 fresh | 4605 untracked | 4268 adopted | 355 marked | 466 validated-ok | 2+0 stale (sig+body) | 0 skipped | 0 failed | elapsed 11:08:11.442 (40091.44s) ===
This commit is contained in:
@@ -7,6 +7,7 @@ namespace adas_core.Test.Models;
|
||||
/// <summary>
|
||||
/// Represents a fake implementation of the ILogger interface, typically used as a test double to simulate logging behavior.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=274aadb -->
|
||||
public class FakeLogger : ILogger
|
||||
{
|
||||
public List<string> Messages { get; } = [];
|
||||
@@ -16,6 +17,7 @@ public class FakeLogger : ILogger
|
||||
/// </summary>
|
||||
/// <param name="enrichers">The collection of enrichers intended to add contextual properties to log events.</param>
|
||||
/// <returns>The current <see cref="ILogger"/> instance, without the supplied enrichers applied.</returns>
|
||||
/// <!-- aidoc:v1 sig=2988ec2 body=62e89c5 -->
|
||||
public ILogger ForContext(IEnumerable<ILogEventEnricher> enrichers)
|
||||
{
|
||||
return this;
|
||||
@@ -28,6 +30,8 @@ public class FakeLogger : ILogger
|
||||
/// <param name="value">The value associated with the property. Can be null.</param>
|
||||
/// <param name="destructureObjects">Indicates whether complex objects should be destructured. Defaults to false.</param>
|
||||
/// <returns>The current <see cref="ILogger"/> instance.</returns>
|
||||
/// <!-- aidoc-review:v1 severity=high kind=wrong_summary
|
||||
/// "The summary states the method 'Creates a logger context enriched with the specified property and value', but the implementation simply returns `this` without doing any enrichment or context creation. The `propertyName`, `value`, and `destructureObjects` parameters are completely ignored." -->
|
||||
public ILogger ForContext(string propertyName, object? value, bool destructureObjects = false)
|
||||
{
|
||||
return this;
|
||||
@@ -38,6 +42,7 @@ public class FakeLogger : ILogger
|
||||
/// </summary>
|
||||
/// <typeparam name="TSource">The source type used to enrich the logger context.</typeparam>
|
||||
/// <returns>The current <see cref="ILogger"/> instance.</returns>
|
||||
/// <!-- aidoc:v1 sig=11a41bb body=62e89c5 -->
|
||||
public ILogger ForContext<TSource>()
|
||||
{
|
||||
return this;
|
||||
@@ -48,6 +53,7 @@ public class FakeLogger : ILogger
|
||||
/// </summary>
|
||||
/// <param name="source">The source type used to enrich the logger context.</param>
|
||||
/// <returns>The current <see cref="ILogger"/> instance.</returns>
|
||||
/// <!-- aidoc:v1 sig=b6256d2 body=62e89c5 -->
|
||||
public ILogger ForContext(Type source)
|
||||
{
|
||||
return this;
|
||||
@@ -57,6 +63,7 @@ public class FakeLogger : ILogger
|
||||
/// Appends the rendered message of the provided log event to the internal messages collection.
|
||||
/// </summary>
|
||||
/// <param name="logEvent">The log event whose rendered message will be added to the collection.</param>
|
||||
/// <!-- aidoc:v1 sig=e35d092 body=03b8903 -->
|
||||
public void Write(LogEvent logEvent)
|
||||
{
|
||||
Messages.Add(logEvent.RenderMessage());
|
||||
@@ -68,6 +75,7 @@ public class FakeLogger : ILogger
|
||||
/// <param name="level">The severity level of the log event.</param>
|
||||
/// <param name="messageTemplate">The message template containing placeholders for the property values.</param>
|
||||
/// <param name="propertyValues">An optional array of objects to format the message template. Can be <see langword="null"/>.</param>
|
||||
/// <!-- aidoc:v1 sig=c2fa9db body=991505c -->
|
||||
public void Write(LogEventLevel level, string messageTemplate, params object?[]? propertyValues)
|
||||
{
|
||||
// Manejar la situación donde propertyValues es nulo, si es necesario
|
||||
@@ -84,6 +92,7 @@ public class FakeLogger : ILogger
|
||||
/// <param name="level">The log event level associated with the entry being written.</param>
|
||||
/// <param name="messageTemplate">The message template containing a format placeholder for the property value.</param>
|
||||
/// <param name="propertyValue">The value to be inserted into the message template.</param>
|
||||
/// <!-- aidoc:v1 sig=f334e80 body=d9646d0 -->
|
||||
public void Write<T>(LogEventLevel level, string messageTemplate, T propertyValue)
|
||||
{
|
||||
Messages.Add(string.Format(messageTemplate, propertyValue));
|
||||
@@ -99,6 +108,7 @@ public class FakeLogger : ILogger
|
||||
/// <param name="exception">An optional exception whose message is recorded when not null.</param>
|
||||
/// <param name="messageTemplate">The message template to log, used directly when <paramref name="propertyValues"/> is null.</param>
|
||||
/// <param name="propertyValues">Optional values to substitute into <paramref name="messageTemplate"/> via <c>string.Format</c>.</param>
|
||||
/// <!-- aidoc:v1 sig=e067f48 body=cc5019f -->
|
||||
public void Write(LogEventLevel level, Exception? exception, string messageTemplate,
|
||||
params object?[]? propertyValues)
|
||||
{
|
||||
@@ -113,6 +123,7 @@ public class FakeLogger : ILogger
|
||||
/// </summary>
|
||||
/// <param name="level">The log event level to evaluate.</param>
|
||||
/// <returns><c>true</c> if logging is enabled for the given level; otherwise, <c>false</c>.</returns>
|
||||
/// <!-- aidoc:v1 sig=2702665 body=eb3da57 -->
|
||||
public bool IsEnabled(LogEventLevel level)
|
||||
{
|
||||
return true;
|
||||
@@ -125,6 +136,7 @@ public class FakeLogger : ILogger
|
||||
/// <param name="exception">An optional exception whose message, when not null, is added to the Messages collection after the formatted message.</param>
|
||||
/// <param name="messageTemplate">The message template string used to format the log entry.</param>
|
||||
/// <param name="propertyValue">The value to be substituted into the message template.</param>
|
||||
/// <!-- aidoc:v1 sig=b73f265 body=2727c3a -->
|
||||
public void Write<T>(LogEventLevel level, Exception? exception, string messageTemplate, T propertyValue)
|
||||
{
|
||||
Messages.Add(string.Format(messageTemplate, propertyValue));
|
||||
|
||||
Reference in New Issue
Block a user