Example #1
0
        /// <summary>Sets the output helper.</summary>
        /// <param name="value">The value.</param>
        /// <param name="minLogLevel"></param>
        /// <autogeneratedoc />
        /// TODO Edit XML Comment Template for SetOutputHelper
        public void SetOutputHelper(ITestOutputHelper value, NLog.LogLevel minLogLevel = null)
        {
            if (_xunitTarget != null)
            {
                AppLoggingConfigHelper.RemoveTarget(_xunitTarget);
                _xunitTarget.Dispose( );
            }

            if (value == null)
            {
                _xunitTarget = null;
                return;
            }

            _xunitTarget = new XunitTarget("Xunit")
            {
                OutputHelper = value
            };
            AppLoggingConfigHelper.AddTarget(_xunitTarget, minLogLevel);
        }
 /// <summary>
 /// Called when an object is no longer needed. Called just before <see cref="System.IDisposable.Dispose"/>
 /// if the class also implements that.
 /// </summary>
 public Task DisposeAsync( )
 {
     AppLoggingConfigHelper.RemoveTarget(_xunitSinkTarget.Name);
     return(Task.CompletedTask);
 }