示例#1
0
        /// <summary>
        /// Adds browser console logging to the <see cref="ILoggingBuilder"/>.
        /// </summary>
        /// <param name="builder">The logging builder.</param>
        /// <param name="configure">A configuration for the <see cref="ConsoleLoggerOptions"/>.</param>
        /// <returns>The logging builder with the browser console logging added.</returns>
        public static ILoggingBuilder AddBrowserConsole(
            this ILoggingBuilder builder, Action <ConsoleLoggerOptions> configure)
        {
            if (configure == null)
            {
                throw new ArgumentNullException(nameof(configure));
            }

            builder.AddBrowserConsole();
#pragma warning disable CA1062
            builder.Services.Configure(configure);
#pragma warning restore CA1062

            return(builder);
        }