Ejemplo n.º 1
0
        /// <summary>
        /// Registers the <c>ILoggerProvider</c> plugin by <paramref name="name"/>.
        /// </summary>
        /// <param name="name">The <c>string</c> of the logger provider.</param>
        /// <param name="isDefault">The <c>bool</c> value indicating whether this is the default logger provider.</param>
        /// <param name="loggerProvider">The <c>ILoggerProvider</c> to register.</param>
        public void Register(string name, bool isDefault, ILoggerProvider loggerProvider)
        {
            var actualDefault = loggerProviderKeeper.FindDefault() == null ? true : isDefault;

            loggerProviderKeeper.Keep(name, actualDefault, loggerProvider);
            defaultLogger = loggerProviderKeeper.FindDefault().Logger;
        }
Ejemplo n.º 2
0
    /// <summary>
    /// Registers the <c>ILoggerProvider</c> plugin by <paramref name="name"/>.
    /// </summary>
    /// <param name="name">The <c>string</c> of the logger provider.</param>
    /// <param name="isDefault">The <c>bool</c> value indicating whether this is the default logger provider.</param>
    /// <param name="loggerProvider">The <c>ILoggerProvider</c> to register.</param>
    public void Register(string name, bool isDefault, ILoggerProvider loggerProvider)
    {
        var actualDefault = _loggerProviderKeeper.FindDefault() == null || isDefault;

        _loggerProviderKeeper.Keep(name, actualDefault, loggerProvider);
        _defaultLogger = _loggerProviderKeeper.FindDefault()?.Logger;
    }