/// <summary> /// Initializes a new <see cref="TextFile"/> based on a <see cref="TextFileConfiguration"/>. /// </summary> /// <param name="config">The configuration.</param> public TextFile(TextFileConfiguration config) { _config = config ?? throw new ArgumentNullException(nameof(config)); _file = new MonitorTextFileOutput(config.Path, config.MaxCountPerFile, false); _countFlush = _config.AutoFlushRate; _countHousekeeping = _config.HousekeepingRate; }
/// <summary> /// Initializes a new <see cref="TextFile"/> bound to its <see cref="TextFileConfiguration"/>. /// </summary> /// <param name="config">The configuration.</param> public TextFile( TextFileConfiguration config ) : base( config ) { if( config == null ) throw new ArgumentNullException( "config" ); _file = new MonitorTextFileOutput( config.Path, config.MaxCountPerFile, config.UseGzipCompression ); _file.FileWriteThrough = config.FileWriteThrough; _file.FileBufferSize = config.FileBufferSize; }
/// <summary> /// Initializes a new <see cref="TextFile"/> bound to its <see cref="TextFileConfiguration"/>. /// </summary> /// <param name="config">The configuration.</param> public TextFile(TextFileConfiguration config) : base(config) { if (config == null) { throw new ArgumentNullException("config"); } _file = new MonitorTextFileOutput(config.Path, config.MaxCountPerFile, config.UseGzipCompression); _file.FileWriteThrough = config.FileWriteThrough; _file.FileBufferSize = config.FileBufferSize; }