Skip to content
Open
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
8d26aec
Fix Setting Azure.DataApiBuilder to none bug
RubenCerna2079 Mar 16, 2026
9d21e65
Fix --loglevel flag
RubenCerna2079 Mar 17, 2026
3bb69d5
Fix bugs
RubenCerna2079 Mar 17, 2026
d0cb93a
Fix bugs log level
RubenCerna2079 Mar 17, 2026
d87ef7b
Fix log level bugs
RubenCerna2079 Mar 25, 2026
100914f
Merge branch 'main' into dev/rubencerna/fix-loglevel-bugs
RubenCerna2079 Mar 25, 2026
2e6d2bf
Fix log buffer so it is only applied when using start option
RubenCerna2079 Mar 26, 2026
741d2d4
Merge branch 'main' into dev/rubencerna/fix-loglevel-bugs
RubenCerna2079 Mar 26, 2026
260a9c0
Add missing comments
RubenCerna2079 Mar 27, 2026
c460cab
Fix syntax errors
RubenCerna2079 Mar 27, 2026
c487a5d
Fix syntax errors
RubenCerna2079 Mar 27, 2026
29818d9
Changes based on comments
RubenCerna2079 Mar 27, 2026
e1ee165
Changes based on comments
RubenCerna2079 Apr 2, 2026
5832465
Fix merge conflict
RubenCerna2079 Apr 2, 2026
0e64146
Changes based on comments
RubenCerna2079 Apr 4, 2026
ddd6508
Merge branch 'main' into dev/rubencerna/fix-loglevel-bugs
Aniruddh25 Apr 4, 2026
85d8381
Changes to CLI section
RubenCerna2079 Apr 9, 2026
0ca53e7
Fix cli
RubenCerna2079 Apr 9, 2026
7101d4a
Merge remote-tracking branch 'refs/remotes/origin/dev/rubencerna/fix-…
RubenCerna2079 Apr 14, 2026
4c981c9
Merge branch 'main' into dev/rubencerna/fix-loglevel-bugs
RubenCerna2079 Apr 14, 2026
4a331eb
Remove unnecessary function
RubenCerna2079 Apr 15, 2026
f580686
Fix syntax errors
RubenCerna2079 Apr 15, 2026
6a8bd36
Merge branch 'main' into dev/rubencerna/fix-loglevel-bugs
RubenCerna2079 Apr 15, 2026
c01dcab
Changes based on comments
RubenCerna2079 Apr 15, 2026
bf3e177
Fix merge conflicts
RubenCerna2079 Apr 15, 2026
4b16470
Merge branch 'main' into dev/rubencerna/fix-loglevel-bugs
RubenCerna2079 Apr 15, 2026
18ee405
Fix tests and small bug
RubenCerna2079 Apr 16, 2026
52b4701
remove unnecessary section
RubenCerna2079 Apr 16, 2026
866b765
Merge branch 'main' into dev/rubencerna/fix-loglevel-bugs
RubenCerna2079 Apr 16, 2026
8f735d5
Fix syntax errors
RubenCerna2079 Apr 16, 2026
734ffcf
Fix syntax errors
RubenCerna2079 Apr 16, 2026
ec622f8
Fix test
RubenCerna2079 Apr 17, 2026
252c82a
Remove test
RubenCerna2079 Apr 17, 2026
fbfb6d1
Reintroduce test
RubenCerna2079 Apr 17, 2026
76703fb
Fix syntax
RubenCerna2079 Apr 17, 2026
d57cbfd
Fix tests
RubenCerna2079 Apr 18, 2026
dba9baa
Add missing tests
RubenCerna2079 Apr 21, 2026
5704bc5
Merge branch 'main' into dev/rubencerna/fix-loglevel-bugs
RubenCerna2079 Apr 21, 2026
9adfa1a
Fix syntax
RubenCerna2079 Apr 21, 2026
0652082
Merge remote-tracking branch 'refs/remotes/origin/dev/rubencerna/fix-…
RubenCerna2079 Apr 21, 2026
61ba04c
Add missing buffer
RubenCerna2079 Apr 22, 2026
89b3cc0
Add comment for tests
RubenCerna2079 Apr 23, 2026
5333dc1
Fix merge conflicts
RubenCerna2079 Apr 23, 2026
d1db8f9
Add message for tests
RubenCerna2079 Apr 25, 2026
b2be5e5
Merge branch 'main' into dev/rubencerna/fix-loglevel-bugs
RubenCerna2079 Apr 25, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 33 additions & 12 deletions src/Cli.Tests/EndToEndTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -821,24 +821,12 @@ public Task TestUpdatingStoredProcedureWithRestMethods()
[DataRow("--LogLevel 0", DisplayName = "LogLevel 0 from command line.")]
[DataRow("--LogLevel 1", DisplayName = "LogLevel 1 from command line.")]
[DataRow("--LogLevel 2", DisplayName = "LogLevel 2 from command line.")]
[DataRow("--LogLevel 3", DisplayName = "LogLevel 3 from command line.")]
[DataRow("--LogLevel 4", DisplayName = "LogLevel 4 from command line.")]
[DataRow("--LogLevel 5", DisplayName = "LogLevel 5 from command line.")]
[DataRow("--LogLevel 6", DisplayName = "LogLevel 6 from command line.")]
[DataRow("--LogLevel Trace", DisplayName = "LogLevel Trace from command line.")]
[DataRow("--LogLevel Debug", DisplayName = "LogLevel Debug from command line.")]
[DataRow("--LogLevel Information", DisplayName = "LogLevel Information from command line.")]
[DataRow("--LogLevel Warning", DisplayName = "LogLevel Warning from command line.")]
[DataRow("--LogLevel Error", DisplayName = "LogLevel Error from command line.")]
[DataRow("--LogLevel Critical", DisplayName = "LogLevel Critical from command line.")]
[DataRow("--LogLevel None", DisplayName = "LogLevel None from command line.")]
[DataRow("--LogLevel tRace", DisplayName = "Case sensitivity: LogLevel Trace from command line.")]
[DataRow("--LogLevel DebUG", DisplayName = "Case sensitivity: LogLevel Debug from command line.")]
[DataRow("--LogLevel information", DisplayName = "Case sensitivity: LogLevel Information from command line.")]
[DataRow("--LogLevel waRNing", DisplayName = "Case sensitivity: LogLevel Warning from command line.")]
[DataRow("--LogLevel eRROR", DisplayName = "Case sensitivity: LogLevel Error from command line.")]
[DataRow("--LogLevel CrItIcal", DisplayName = "Case sensitivity: LogLevel Critical from command line.")]
[DataRow("--LogLevel NONE", DisplayName = "Case sensitivity: LogLevel None from command line.")]
public void TestEngineStartUpWithVerboseAndLogLevelOptions(string logLevelOption)
{
_fileSystem!.File.WriteAllText(TEST_RUNTIME_CONFIG_FILE, INITIAL_CONFIG);
Expand All @@ -857,6 +845,39 @@ public void TestEngineStartUpWithVerboseAndLogLevelOptions(string logLevelOption
StringAssert.Contains(output, $"User provided config file: {TEST_RUNTIME_CONFIG_FILE}", StringComparison.Ordinal);
}

/// <summary>
/// Test to validate that the engine starts successfully when --LogLevel is set to Warning
/// or above. At these levels, CLI phase messages (logged at Information) are suppressed,
/// so no stdout output is expected during the CLI phase.
/// </summary>
/// <param name="logLevelOption">Log level options</param>
[DataTestMethod]
[DataRow("--LogLevel 3", DisplayName = "LogLevel 3 from command line.")]
[DataRow("--LogLevel 4", DisplayName = "LogLevel 4 from command line.")]
[DataRow("--LogLevel 5", DisplayName = "LogLevel 5 from command line.")]
[DataRow("--LogLevel 6", DisplayName = "LogLevel 6 from command line.")]
[DataRow("--LogLevel Warning", DisplayName = "LogLevel Warning from command line.")]
[DataRow("--LogLevel Error", DisplayName = "LogLevel Error from command line.")]
[DataRow("--LogLevel Critical", DisplayName = "LogLevel Critical from command line.")]
[DataRow("--LogLevel None", DisplayName = "LogLevel None from command line.")]
[DataRow("--LogLevel waRNing", DisplayName = "Case sensitivity: LogLevel Warning from command line.")]
[DataRow("--LogLevel eRROR", DisplayName = "Case sensitivity: LogLevel Error from command line.")]
[DataRow("--LogLevel CrItIcal", DisplayName = "Case sensitivity: LogLevel Critical from command line.")]
[DataRow("--LogLevel NONE", DisplayName = "Case sensitivity: LogLevel None from command line.")]
public void TestEngineStartUpWithHighLogLevelOptions(string logLevelOption)
{
_fileSystem!.File.WriteAllText(TEST_RUNTIME_CONFIG_FILE, INITIAL_CONFIG);

using Process process = ExecuteDabCommand(
command: $"start --config {TEST_RUNTIME_CONFIG_FILE}",
logLevelOption
);

string? output = process.StandardOutput.ReadLine();
Assert.IsNull(output);
process.Kill();
}

/// <summary>
/// Validates that valid usage of verbs and associated options produce exit code 0 (CliReturnCode.SUCCESS).
/// Verifies that explicitly implemented verbs (add, update, init, start) and appropriately
Expand Down
4 changes: 2 additions & 2 deletions src/Cli.Tests/UtilsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ public void TestMergeConfig()

Environment.SetEnvironmentVariable(RUNTIME_ENVIRONMENT_VAR_NAME, "Test");

Assert.IsTrue(ConfigMerger.TryMergeConfigsIfAvailable(fileSystem, loader, new StringLogger(), out string? mergedConfig), "Failed to merge config files");
Assert.IsTrue(ConfigMerger.TryMergeConfigsIfAvailable(fileSystem, loader, out string? mergedConfig), "Failed to merge config files");
Assert.AreEqual(mergedConfig, "dab-config.Test.merged.json");
Assert.IsTrue(fileSystem.File.Exists(mergedConfig));
Assert.IsTrue(JToken.DeepEquals(JObject.Parse(MERGED_CONFIG), JObject.Parse(fileSystem.File.ReadAllText(mergedConfig))));
Expand Down Expand Up @@ -309,7 +309,7 @@ public void TestMergeConfigAvailability(

Assert.AreEqual(
expectedIsMergedConfigAvailable,
ConfigMerger.TryMergeConfigsIfAvailable(fileSystem, loader, new StringLogger(), out string? mergedConfigFile),
ConfigMerger.TryMergeConfigsIfAvailable(fileSystem, loader, out string? mergedConfigFile),
"Availability of merge config should match");
Assert.AreEqual(expectedMergedConfigFileName, mergedConfigFile, "Merge config file name should match expected");

Expand Down
7 changes: 4 additions & 3 deletions src/Cli/Commands/StartOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ namespace Cli.Commands
[Verb("start", isDefault: false, HelpText = "Start Data Api Builder Engine", Hidden = false)]
public class StartOptions : Options
{
private static LogBuffer _cliBuffer = new();
private const string LOGLEVEL_HELPTEXT = "Specifies logging level as provided value. For possible values, see: https://go.microsoft.com/fwlink/?linkid=2263106";

public StartOptions(bool verbose, LogLevel? logLevel, bool isHttpsRedirectionDisabled, bool mcpStdio, string? mcpRole, string config)
Expand Down Expand Up @@ -48,13 +49,13 @@ public StartOptions(bool verbose, LogLevel? logLevel, bool isHttpsRedirectionDis

public int Handler(ILogger logger, FileSystemRuntimeConfigLoader loader, IFileSystem fileSystem)
Comment thread
RubenCerna2079 marked this conversation as resolved.
{
logger.LogInformation("{productName} {version}", PRODUCT_NAME, ProductInfo.GetProductVersion());
ConfigGenerator.SetBufferForCliConfigGenerator(_cliBuffer);
ConfigGenerator.SendLogToBufferOrLogger(Microsoft.Extensions.Logging.LogLevel.Information, $"{PRODUCT_NAME} {ProductInfo.GetProductVersion()}");
bool isSuccess = ConfigGenerator.TryStartEngineWithOptions(this, loader, fileSystem);

if (!isSuccess)
{
logger.LogError("Failed to start the engine{mode}.",
McpStdio ? " in MCP stdio mode" : string.Empty);
ConfigGenerator.SendLogToBufferOrLogger(Microsoft.Extensions.Logging.LogLevel.Error, $"Failed to start the engine{(McpStdio ? " in MCP stdio mode" : string.Empty)}.");
}

return isSuccess ? CliReturnCode.SUCCESS : CliReturnCode.GENERAL_ERROR;
Expand Down
50 changes: 39 additions & 11 deletions src/Cli/ConfigGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public class ConfigGenerator
{
#pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable.
private static ILogger<ConfigGenerator> _logger;
private static LogBuffer? _cliBuffer;
#pragma warning restore CS8618

public static void SetLoggerForCliConfigGenerator(
Expand All @@ -37,6 +38,11 @@ public static void SetLoggerForCliConfigGenerator(
_logger = configGeneratorLoggerFactory;
}

public static void SetBufferForCliConfigGenerator(LogBuffer cliBuffer)
{
_cliBuffer = cliBuffer;
Comment thread
RubenCerna2079 marked this conversation as resolved.
Outdated
}

/// <summary>
/// This method will generate the initial config with databaseType and connection-string.
/// </summary>
Expand Down Expand Up @@ -2564,17 +2570,17 @@ public static bool TryStartEngineWithOptions(StartOptions options, FileSystemRun
// Replaces all the environment variables while deserializing when starting DAB.
if (!loader.TryLoadKnownConfig(out RuntimeConfig? deserializedRuntimeConfig, replaceEnvVar: true))
{
_logger.LogError("Failed to parse the config file: {runtimeConfigFile}.", runtimeConfigFile);
SendLogToBufferOrLogger(LogLevel.Error, $"Failed to parse the config file: {runtimeConfigFile}.");
return false;
}
else
{
_logger.LogInformation("Loaded config file: {runtimeConfigFile}", runtimeConfigFile);
SendLogToBufferOrLogger(LogLevel.Information, $"Loaded config file: {runtimeConfigFile}");
}

if (string.IsNullOrWhiteSpace(deserializedRuntimeConfig.DataSource.ConnectionString))
{
_logger.LogError("Invalid connection-string provided in the config.");
SendLogToBufferOrLogger(LogLevel.Error, "Invalid connection-string provided in the config.");
return false;
}

Expand All @@ -2589,23 +2595,27 @@ public static bool TryStartEngineWithOptions(StartOptions options, FileSystemRun
{
if (options.LogLevel is < LogLevel.Trace or > LogLevel.None)
{
_logger.LogError(
"LogLevel's valid range is 0 to 6, your value: {logLevel}, see: https://learn.microsoft.com/dotnet/api/microsoft.extensions.logging.loglevel",
options.LogLevel);
SendLogToBufferOrLogger(LogLevel.Error,
$"LogLevel's valid range is 0 to 6, your value: {options.LogLevel}, see: https://learn.microsoft.com/dotnet/api/microsoft.extensions.logging.loglevel");
return false;
}

minimumLogLevel = (LogLevel)options.LogLevel;
_logger.LogInformation("Setting minimum LogLevel: {minimumLogLevel}.", minimumLogLevel);
SendLogToBufferOrLogger(LogLevel.Information, $"Setting minimum LogLevel: {minimumLogLevel}.");
}
else
{
minimumLogLevel = deserializedRuntimeConfig.GetConfiguredLogLevel();
HostMode hostModeType = deserializedRuntimeConfig.IsDevelopmentMode() ? HostMode.Development : HostMode.Production;

_logger.LogInformation($"Setting default minimum LogLevel: {minimumLogLevel} for {hostModeType} mode.", minimumLogLevel, hostModeType);
SendLogToBufferOrLogger(LogLevel.Information, $"Setting default minimum LogLevel: {minimumLogLevel} for {hostModeType} mode.");
}

Utils.LoggerFactoryForCli = Utils.GetLoggerFactoryForCli(minimumLogLevel);
ILogger<ConfigGenerator> configGeneratorLogger = Utils.LoggerFactoryForCli.CreateLogger<ConfigGenerator>();
SetLoggerForCliConfigGenerator(configGeneratorLogger);
_cliBuffer?.FlushToLogger(_logger);

args.Add("--LogLevel");
args.Add(minimumLogLevel.ToString());

Expand Down Expand Up @@ -2698,14 +2708,14 @@ public static bool TryGetConfigForRuntimeEngine(
IFileSystem fileSystem,
out string runtimeConfigFile)
{
if (string.IsNullOrEmpty(configToBeUsed) && ConfigMerger.TryMergeConfigsIfAvailable(fileSystem, loader, _logger, out configToBeUsed))
if (string.IsNullOrEmpty(configToBeUsed) && ConfigMerger.TryMergeConfigsIfAvailable(fileSystem, loader, out configToBeUsed))
{
_logger.LogInformation("Using merged config file based on environment: {configToBeUsed}.", configToBeUsed);
SendLogToBufferOrLogger(LogLevel.Information, $"Using merged config file based on environment: {configToBeUsed}.");
}

if (!TryGetConfigFileBasedOnCliPrecedence(loader, configToBeUsed, out runtimeConfigFile))
{
_logger.LogError("Config not provided and default config file doesn't exist.");
SendLogToBufferOrLogger(LogLevel.Error, "Config not provided and default config file doesn't exist.");
return false;
}

Expand Down Expand Up @@ -3622,5 +3632,23 @@ private static bool ValidateFields(

return true;
}

/// <summary>
/// Helper method that sends the log to the buffer if the buffer has being set up.
Comment thread
RubenCerna2079 marked this conversation as resolved.
Outdated
/// Else, it will send the log to the logger.
/// </summary>
/// <param name="logLevel">LogLevel of the log.</param>
/// <param name="message">Message that will be printed in the log.</param>
Comment thread
RubenCerna2079 marked this conversation as resolved.
Outdated
public static void SendLogToBufferOrLogger(LogLevel logLevel, string message, Exception? ex = null)
{
if (_cliBuffer is not null)
{
_cliBuffer.BufferLog(logLevel, message, ex);
}
else
{
_logger.Log(logLevel, ex, message);
}
}
}
}
8 changes: 4 additions & 4 deletions src/Cli/ConfigMerger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public static class ConfigMerger
/// and create a merged file called dab-config.{DAB_ENVIRONMENT}.merged.json
/// </summary>
/// <returns>Returns the name of the merged Config if successful.</returns>
public static bool TryMergeConfigsIfAvailable(IFileSystem fileSystem, FileSystemRuntimeConfigLoader loader, ILogger logger, out string? mergedConfigFile)
public static bool TryMergeConfigsIfAvailable(IFileSystem fileSystem, FileSystemRuntimeConfigLoader loader, out string? mergedConfigFile)
{
string? environmentValue = Environment.GetEnvironmentVariable(FileSystemRuntimeConfigLoader.RUNTIME_ENVIRONMENT_VAR_NAME);
mergedConfigFile = null;
Expand All @@ -32,16 +32,16 @@ public static bool TryMergeConfigsIfAvailable(IFileSystem fileSystem, FileSystem
string overrideConfigJson = fileSystem.File.ReadAllText(environmentBasedConfigFile);

string currentDir = fileSystem.Directory.GetCurrentDirectory();
logger.LogInformation("Merging {baseFilePath} and {envFilePath}", Path.Combine(currentDir, baseConfigFile), Path.Combine(currentDir, environmentBasedConfigFile));
ConfigGenerator.SendLogToBufferOrLogger(LogLevel.Information, $"Merging {Path.Combine(currentDir, baseConfigFile)} and {Path.Combine(currentDir, environmentBasedConfigFile)}");
string mergedConfigJson = MergeJsonProvider.Merge(baseConfigJson, overrideConfigJson);
mergedConfigFile = FileSystemRuntimeConfigLoader.GetMergedFileNameForEnvironment(FileSystemRuntimeConfigLoader.CONFIGFILE_NAME, environmentValue);
fileSystem.File.WriteAllText(mergedConfigFile, mergedConfigJson);
logger.LogInformation("Generated merged config file: {mergedFile}", Path.Combine(currentDir, mergedConfigFile));
ConfigGenerator.SendLogToBufferOrLogger(LogLevel.Information, $"Generated merged config file: {Path.Combine(currentDir, mergedConfigFile)}");
Comment thread
RubenCerna2079 marked this conversation as resolved.
Outdated
return true;
}
catch (Exception ex)
{
logger.LogError(ex, "Failed to merge the config files.");
ConfigGenerator.SendLogToBufferOrLogger(LogLevel.Error, "Failed to merge the config files.", ex);
mergedConfigFile = null;
return false;
}
Expand Down
21 changes: 17 additions & 4 deletions src/Cli/CustomLoggerProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,30 @@
/// </summary>
public class CustomLoggerProvider : ILoggerProvider
{
private readonly LogLevel _minimumLogLevel;

public CustomLoggerProvider(LogLevel minimumLogLevel = LogLevel.Information)
{
_minimumLogLevel = minimumLogLevel;
}

public void Dispose() { }

/// <inheritdoc/>
public ILogger CreateLogger(string categoryName)
{
return new CustomConsoleLogger();
return new CustomConsoleLogger(_minimumLogLevel);
}

public class CustomConsoleLogger : ILogger
{
// Minimum LogLevel. LogLevel below this would be disabled.
private readonly LogLevel _minimumLogLevel = LogLevel.Information;
private readonly LogLevel _minimumLogLevel;

public CustomConsoleLogger(LogLevel minimumLogLevel = LogLevel.Information)
{
_minimumLogLevel = minimumLogLevel;
}

// Color values based on LogLevel
// LogLevel Foreground Background
Expand Down Expand Up @@ -61,7 +73,7 @@ public class CustomConsoleLogger : ILogger
/// </summary>
public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)
{
if (!IsEnabled(logLevel) || logLevel < _minimumLogLevel)
if (!IsEnabled(logLevel))
{
return;
}
Expand All @@ -79,8 +91,9 @@ public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Except
/// <inheritdoc/>
public bool IsEnabled(LogLevel logLevel)
{
return true;
return logLevel != LogLevel.None && logLevel >= _minimumLogLevel;
Comment thread
RubenCerna2079 marked this conversation as resolved.
}

public IDisposable? BeginScope<TState>(TState state) where TState : notnull
{
throw new NotImplementedException();
Expand Down
10 changes: 5 additions & 5 deletions src/Cli/Utils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -314,14 +314,14 @@ public static bool TryGetConfigFileBasedOnCliPrecedence(
if (!string.IsNullOrEmpty(userProvidedConfigFile))
{
/// The existence of user provided config file is not checked here.
_logger.LogInformation("User provided config file: {userProvidedConfigFile}", userProvidedConfigFile);
ConfigGenerator.SendLogToBufferOrLogger(LogLevel.Information, $"User provided config file: {userProvidedConfigFile}");
runtimeConfigFile = userProvidedConfigFile;
return true;
}
else
{
_logger.LogInformation("Config not provided. Trying to get default config based on DAB_ENVIRONMENT...");
_logger.LogInformation("Environment variable DAB_ENVIRONMENT is {environment}", Environment.GetEnvironmentVariable("DAB_ENVIRONMENT"));
ConfigGenerator.SendLogToBufferOrLogger(LogLevel.Information, "Config not provided. Trying to get default config based on DAB_ENVIRONMENT...");
ConfigGenerator.SendLogToBufferOrLogger(LogLevel.Information, $"Environment variable DAB_ENVIRONMENT is {Environment.GetEnvironmentVariable("DAB_ENVIRONMENT")}");
runtimeConfigFile = loader.GetFileNameForEnvironment(null, considerOverrides: false);
}

Expand Down Expand Up @@ -961,10 +961,10 @@ public static bool IsEntityProvided(string? entity, ILogger cliLogger, string co
/// <summary>
/// Returns ILoggerFactory with CLI custom logger provider.
/// </summary>
public static ILoggerFactory GetLoggerFactoryForCli()
public static ILoggerFactory GetLoggerFactoryForCli(LogLevel minimumLogLevel = LogLevel.Information)
Comment thread
RubenCerna2079 marked this conversation as resolved.
{
ILoggerFactory loggerFactory = new LoggerFactory();
loggerFactory.AddProvider(new CustomLoggerProvider());
loggerFactory.AddProvider(new CustomLoggerProvider(minimumLogLevel));
return loggerFactory;
}
}
Expand Down
Loading