using Microsoft.Extensions.Logging;
namespace Migrato.Cli;
///
/// Builds the shared by CLI commands
///
internal static class Logging
{
///
/// Creates a logger factory that writes to stderr, keeping stdout free for command output
///
public static ILoggerFactory CreateFactory(bool verbose) =>
LoggerFactory.Create(builder => builder
.AddConsole(options => options.LogToStandardErrorThreshold = LogLevel.Trace)
.SetMinimumLevel(verbose ? LogLevel.Debug : LogLevel.Warning));
}