/// <summary> /// Initializes an instance of <see cref="ColorConsoleLogger"/>. /// </summary> /// <param name="name">The category name for each <see cref="ILogger"/> instance. This is usually the class name where the logger is initialized.</param> /// <param name="config">The <see cref="ColorConsoleLoggerConfiguration"/> settings to be used for logging.</param> public ColorConsoleLogger(ColorConsoleLoggerConfiguration config) { _config = config; }
/// <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)); }
/// <summary> /// Initializes an instance of <see cref="ColorConsoleLogger"/>. /// </summary> /// <param name="name">The category name for each <see cref="ILogger"/> instance. This is usually the class name where the logger is initialized.</param> /// <param name="config">The <see cref="ColorConsoleLoggerConfiguration"/> settings to be used for logging.</param> public ColorConsoleLogger(string name, ColorConsoleLoggerConfiguration config) { _name = name; _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); }