serilog / serilog-sinks-console

Write log events to System.Console as text or JSON, with ANSI theme support
Apache License 2.0
245 stars 72 forks source link

Add support C# 8 nullable reference types #97

Closed rafaelsc closed 4 months ago

rafaelsc commented 4 years ago

Does this issue relate to a new feature or an existing bug?

What is the target framework and operating system affected by this issue? Please see target frameworks & net standard matrix.

Describe the solution you'd like Enable nullable-references in Serilog and add update the codebase to support the nullable reference types in .NET Core 3.0 and 3.1.

Additional context Links about the Nullable reference types :

rafaelsc commented 4 years ago

Related - https://github.com/serilog/serilog/issues/1455

jwdonahue commented 3 years ago

I would really love to see this feature enabled soon. This looks scary:

  var logger = loggerMinimumLevelConfiguration
           !.Enrich?.With(enricher)
           ?.WriteTo.File(logPathFileName,
                   rollingInterval: interval,
                   outputTemplate: outputTemplate)
           ?.CreateLogger();
  Verify.IsNotNull(logger);

Is there anything I can do to help it along?

Numpsy commented 4 months ago

I think the nullability annotations should be enabled in the latest version now.