Skip to content

Commit

Permalink
#124 LoggingEvent.Level not nullable
Browse files Browse the repository at this point in the history
  • Loading branch information
FreeAndNil committed Apr 4, 2024
1 parent 202bb5c commit bf9a21d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions src/log4net.Tests/Util/CyclicBufferTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ public void TestSize1()
Assert.AreEqual(0, cb.Length, "Empty Buffer should have length 0");
Assert.AreEqual(1, cb.MaxSize, "Buffer should have max size 1");

LoggingEvent event1 = new LoggingEvent(null, null, null, null, null, null);
LoggingEvent event2 = new LoggingEvent(null, null, null, null, null, null);
LoggingEvent event1 = new LoggingEvent(null, null, null, Level.All, null, null);
LoggingEvent event2 = new LoggingEvent(null, null, null, Level.All, null, null);

LoggingEvent? discardedEvent = cb.Append(event1);

Expand Down Expand Up @@ -77,9 +77,9 @@ public void TestSize2()
Assert.AreEqual(0, cb.Length, "Empty Buffer should have length 0");
Assert.AreEqual(2, cb.MaxSize, "Buffer should have max size 2");

LoggingEvent event1 = new LoggingEvent(null, null, null, null, null, null);
LoggingEvent event2 = new LoggingEvent(null, null, null, null, null, null);
LoggingEvent event3 = new LoggingEvent(null, null, null, null, null, null);
LoggingEvent event1 = new LoggingEvent(null, null, null, Level.All, null, null);
LoggingEvent event2 = new LoggingEvent(null, null, null, Level.All, null, null);
LoggingEvent event3 = new LoggingEvent(null, null, null, Level.All, null, null);

LoggingEvent? discardedEvent;

Expand Down
2 changes: 1 addition & 1 deletion src/log4net/Core/ILogger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public interface ILogger
/// This generic form is intended to be used by wrappers.
/// </para>
/// </remarks>
void Log(Type callerStackBoundaryDeclaringType, Level? level, object? message, Exception? exception);
void Log(Type callerStackBoundaryDeclaringType, Level level, object? message, Exception? exception);

/// <summary>
/// Logs the specified logging event through this logger.
Expand Down
4 changes: 2 additions & 2 deletions src/log4net/Core/LoggingEvent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public struct LoggingEventData
/// Due to its special serialization it cannot be declared final either.
/// </para>
/// </remarks>
public Level? Level;
public Level Level;

/// <summary>
/// The application supplied message.
Expand Down Expand Up @@ -198,7 +198,7 @@ public LoggingEvent(
Type? callerStackBoundaryDeclaringType,
ILoggerRepository? repository,
string? loggerName,
Level? level,
Level level,
object? message,
Exception? exception)
{
Expand Down
4 changes: 2 additions & 2 deletions src/log4net/Repository/Hierarchy/Logger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ public virtual void RemoveAllAppenders()
/// This method must not throw any exception to the caller.
/// </para>
/// </remarks>
public virtual void Log(Type? callerStackBoundaryDeclaringType, Level? level, object? message, Exception? exception)
public virtual void Log(Type? callerStackBoundaryDeclaringType, Level level, object? message, Exception? exception)
{
try
{
Expand Down Expand Up @@ -577,7 +577,7 @@ public virtual void Log(Level level, object? message, Exception? exception)
/// appenders.
/// </para>
/// </remarks>
protected virtual void ForcedLog(Type callerStackBoundaryDeclaringType, Level? level, object? message, Exception? exception)
protected virtual void ForcedLog(Type callerStackBoundaryDeclaringType, Level level, object? message, Exception? exception)
{
CallAppenders(new LoggingEvent(callerStackBoundaryDeclaringType, Hierarchy, Name, level, message, exception));
}
Expand Down

0 comments on commit bf9a21d

Please sign in to comment.