/// <summary> /// Initializes a new instance of the <see cref="TextWriterLogger{W}" /> class. /// </summary> /// <param name="provider">The function that returns the <see cref="TextWriter" /> instance that should be used for logging operation.</param> /// <param name="disposer">The optional disposer for the instance of the result of <paramref name="provider" />.</param> /// <param name="isThreadSafe">Logger should be thread safe or not.</param> /// <param name="syncRoot">The unique object for thread safe operations.</param> /// <exception cref="ArgumentNullException"> /// <paramref name="provider" /> and/or <paramref name="syncRoot" /> are <see langword="null" />. /// </exception> public TextWriterLogger(TextWriterProvider provider, TextWriterAction disposer, bool isThreadSafe, object syncRoot) : base(isThreadSafe, syncRoot) { if (provider == null) { throw new ArgumentNullException("provider"); } this._DISPOSER = disposer; this._PROVIDER = provider; }
/// <summary> /// Initializes a new instance of the <see cref="TextWriterLogger{W}" /> class. /// </summary> /// <param name="provider">The function that returns the <see cref="TextWriter" /> instance that should be used for logging operation.</param> /// <param name="disposer">The optional disposer for the instance of the result of <paramref name="provider" />.</param> /// <exception cref="ArgumentNullException"> /// <paramref name="provider" /> is <see langword="null" />. /// </exception> public TextWriterLogger(TextWriterProvider provider, TextWriterAction disposer) : this(provider, disposer, true) { }
/// <summary> /// Initializes a new instance of the <see cref="TextWriterLogger{W}" /> class. /// </summary> /// <param name="provider">The function that returns the <see cref="TextWriter" /> instance that should be used for logging operation.</param> /// <param name="disposer">The optional disposer for the instance of the result of <paramref name="provider" />.</param> /// <param name="isThreadSafe">Logger should be thread safe or not.</param> /// <exception cref="ArgumentNullException"> /// <paramref name="provider" /> is <see langword="null" />. /// </exception> public TextWriterLogger(TextWriterProvider provider, TextWriterAction disposer, bool isThreadSafe) : this(provider, disposer, isThreadSafe, new object()) { }
/// <summary> /// Initializes a new instance of the <see cref="TextWriterLogger{W}" /> class. /// </summary> /// <param name="provider">The function that returns the <see cref="TextWriter" /> instance that should be used for logging operation.</param> /// <param name="disposer">The optional disposer for the instance of the result of <paramref name="provider" />.</param> /// <param name="syncRoot">The unique object for thread safe operations.</param> /// <exception cref="ArgumentNullException"> /// <paramref name="provider" /> and/or <paramref name="syncRoot" /> are <see langword="null" />. /// </exception> public TextWriterLogger(TextWriterProvider provider, TextWriterAction disposer, object syncRoot) : this(provider, disposer, true, syncRoot) { }