Something went wrong. Try again.
A database migration tool for .NET
Something went wrong. Try again.
608 B · 17 lines
C#
at develop
123456789101112131415161718using Microsoft.Extensions.Logging;
namespace Migrato.Cli;
/// <summary>/// Builds the <see cref="ILoggerFactory"/> shared by CLI commands/// </summary>internal static class Logging{ /// <summary> /// Creates a logger factory that writes to stderr, keeping stdout free for command output /// </summary> public static ILoggerFactory CreateFactory(bool verbose) => LoggerFactory.Create(builder => builder .AddConsole(options => options.LogToStandardErrorThreshold = LogLevel.Trace) .SetMinimumLevel(verbose ? LogLevel.Debug : LogLevel.Warning));}