/// <summary>
        /// Add a new <see cref="ColorConsoleLoggerProvider"/> instance, with the default <see cref="ColorConsoleLoggerConfiguration"/> settings.
        /// </summary>
        /// <param name="loggerFactory">The type for which this extension method is defined.</param>
        /// <returns>The <see cref="ILoggerFactory "/> instance.</returns>
        public static ILoggerFactory AddColorConsoleLogger(this ILoggerFactory loggerFactory)
        {
            var config = new ColorConsoleLoggerConfiguration();

            return(loggerFactory.AddColorConsoleLogger(config));
        }
Exemplo n.º 2
0
 /// <summary>
 /// Initialize an instance of <see cref="ColorConsoleLoggerProvider"/> with the supplied <see cref="ColorConsoleLoggerConfiguration"/>.
 /// </summary>
 /// <param name="config">The <see cref="ColorConsoleLoggerConfiguration"/> settings to be used for logging.</param>
 public ColorConsoleLoggerProvider(ColorConsoleLoggerConfiguration config)
 {
     _config = config;
 }
 /// <summary>
 /// Add a new <see cref="ColorConsoleLoggerProvider"/> instance, with the supplied <see cref="ColorConsoleLoggerConfiguration"/> settings.
 /// </summary>
 /// <param name="loggerFactory">The type for which this extension method is defined.</param>
 /// <param name="config">The <see cref="ColorConsoleLoggerConfiguration"/> settings to be used for logging.</param>
 /// <returns>The <see cref="ILoggerFactory "/> instance.</returns>
 public static ILoggerFactory AddColorConsoleLogger(this ILoggerFactory loggerFactory, ColorConsoleLoggerConfiguration config)
 {
     loggerFactory.AddProvider(new ColorConsoleLoggerProvider(config));
     return(loggerFactory);
 }