public void ApplySettings(OperationLogWriterSettings settings) { if (settings == null) { throw new ArgumentNullException($"'{nameof(settings)}' can't be null."); } if (!Directory.Exists(settings.LogFolder)) { Directory.CreateDirectory(settings.LogFolder); } lock (this.fileWriter) { this.folder = settings.LogFolder; } }
public OperationLogWriter(IFileWriter fileWriter, OperationLogWriterSettings settings) { this.fileWriter = fileWriter; this.ApplySettings(settings); }