From 5d6411e10b9b2b22709341039c662d8df1684eac Mon Sep 17 00:00:00 2001 From: YevgeniyShunevych Date: Sat, 18 Jan 2025 11:19:25 +0100 Subject: [PATCH] Add `#nullable enable` to `ILogConsumer`, `INamedLogConsumer`, `IInitializableLogConsumer` and `LogConsumerBuilderExtensions` --- src/Atata/Context/LogConsumerBuilderExtensions.cs | 6 ++++-- src/Atata/Logging/IInitializableLogConsumer.cs | 4 +++- src/Atata/Logging/ILogConsumer.cs | 4 +++- src/Atata/Logging/INamedLogConsumer.cs | 6 ++++-- 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/Atata/Context/LogConsumerBuilderExtensions.cs b/src/Atata/Context/LogConsumerBuilderExtensions.cs index b55bd153..1d803370 100644 --- a/src/Atata/Context/LogConsumerBuilderExtensions.cs +++ b/src/Atata/Context/LogConsumerBuilderExtensions.cs @@ -1,4 +1,6 @@ -namespace Atata; +#nullable enable + +namespace Atata; /// /// Provides extension methods for . @@ -14,7 +16,7 @@ public static class LogConsumerBuilderExtensions /// The same builder instance. public static LogConsumerBuilder WithLoggerName( this LogConsumerBuilder builder, - string loggerName) + string? loggerName) where TLogConsumer : INamedLogConsumer { builder.Consumer.LoggerName = loggerName; diff --git a/src/Atata/Logging/IInitializableLogConsumer.cs b/src/Atata/Logging/IInitializableLogConsumer.cs index bb618362..4c4bc5c8 100644 --- a/src/Atata/Logging/IInitializableLogConsumer.cs +++ b/src/Atata/Logging/IInitializableLogConsumer.cs @@ -1,4 +1,6 @@ -namespace Atata; +#nullable enable + +namespace Atata; /// /// An interface of log consumer that requires initialization. diff --git a/src/Atata/Logging/ILogConsumer.cs b/src/Atata/Logging/ILogConsumer.cs index 669b9519..eb64a33a 100644 --- a/src/Atata/Logging/ILogConsumer.cs +++ b/src/Atata/Logging/ILogConsumer.cs @@ -1,4 +1,6 @@ -namespace Atata; +#nullable enable + +namespace Atata; /// /// Defines a method to log the event information. diff --git a/src/Atata/Logging/INamedLogConsumer.cs b/src/Atata/Logging/INamedLogConsumer.cs index 648b87c9..aa5c7a70 100644 --- a/src/Atata/Logging/INamedLogConsumer.cs +++ b/src/Atata/Logging/INamedLogConsumer.cs @@ -1,4 +1,6 @@ -namespace Atata; +#nullable enable + +namespace Atata; /// /// Represents the log consumer that provides the logger name. @@ -8,5 +10,5 @@ public interface INamedLogConsumer : ILogConsumer /// /// Gets or sets the name of the logger. /// - string LoggerName { get; set; } + string? LoggerName { get; set; } }