Removed default value and added exception.

This commit is contained in:
Alexander Kislitsyn 2020-05-21 18:52:06 +03:00
parent a2a2451a6b
commit ed95e98a27

View file

@ -7,11 +7,11 @@ namespace Microsoft.Extensions.Logging
{ {
class NotepadLogger : ILogger class NotepadLogger : ILogger
{ {
public NotepadLogger(ObjectPool<StringBuilder> stringBuilderPool, string categoryName, string windowName = null) public NotepadLogger(ObjectPool<StringBuilder> stringBuilderPool, string categoryName, string windowName)
{ {
this.stringBuilderPool = stringBuilderPool; this.stringBuilderPool = stringBuilderPool;
this.categoryName = categoryName; this.categoryName = categoryName;
this.windowName = windowName; this.windowName = windowName ?? throw new ArgumentNullException("Window name cannot be null.");
} }
readonly ObjectPool<StringBuilder> stringBuilderPool; readonly ObjectPool<StringBuilder> stringBuilderPool;