public ConsoleLog(ConsoleLogTarget target, Encoding encoding, int bufferSize, ConsoleLogStyle defaultStyle) { if (!target.IsValid()) { throw new ArgumentOutOfRangeException(nameof(target)); } if (encoding == null) { throw new ArgumentNullException(nameof(encoding)); } if (bufferSize < 0) { throw new ArgumentOutOfRangeException(nameof(bufferSize)); } Stream tempStream = null; try { tempStream = OpenStandardStream(target, bufferSize); writer = new StreamWriter(tempStream, encoding, bufferSize); tempStream = null; } finally { tempStream?.Close(); } this.defaultStyle = defaultStyle; }
public ConsoleLog(ConsoleLogTarget target, Encoding encoding, ConsoleLogStyle defaultStyle) : this(target, encoding, DefaultBufferSize, defaultStyle) { }
public ConsoleLog(ConsoleLogStyle defaultStyle) : this(ConsoleLogTarget.Out, Console.OutputEncoding, DefaultBufferSize, defaultStyle) { }