Skip to content

Commit

Permalink
Outputs the configured log level on execution
Browse files Browse the repository at this point in the history
  • Loading branch information
daveaglick committed Dec 22, 2022
1 parent 72b6d70 commit 2b346c8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
- Fixed `ElseIf` when `Predicate.RequiresDocument` is false in `ExecuteIf` module (#255, #256, thanks @nils-a).
- Adds the ability to configure a specific date/time as "current". All code and themes should now use `IExecutionState.GetCurrentDateTime()` instead of `DateTime.Now`, etc.
- Removes console background color for better compatibility with different console themes (#257).
- Outputs the configured log level on execution.

# 1.0.0-beta.63

Expand Down
6 changes: 4 additions & 2 deletions src/core/Statiq.Core/Execution/Engine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using Statiq.Common;

namespace Statiq.Core
Expand Down Expand Up @@ -419,10 +420,11 @@ public async Task<IPipelineOutputs> ExecuteAsync(string[] pipelines, bool normal
// Log
Logger.LogInformation("========== Execution ==========");
Logger.LogInformation($"Executing {ExecutingPipelines.Count} pipelines ({string.Join(", ", ExecutingPipelines.Keys.OrderBy(x => x))})");
Logger.LogDebug($"Execution ID: {ExecutionId}");
Logger.LogDebug($"Clean mode: {FileCleaner.CleanMode}");
Logger.LogInformation($"Absolute Execution Date/Time: {ExecutionDateTime.ToString("yyyy-MM-dd HH:mm:ss", System.Globalization.CultureInfo.InvariantCulture)}");
Logger.LogInformation($"Configured Current Date/Time: {this.GetCurrentDateTime().ToString("yyyy-MM-dd HH:mm:ss", System.Globalization.CultureInfo.InvariantCulture)}");
Logger.LogInformation($"Minimum Configured Log Level: {Services.GetRequiredService<IOptions<LoggerFilterOptions>>().Value.MinLevel.ToString()}");
Logger.LogDebug($"Execution ID: {ExecutionId}");
Logger.LogDebug($"Clean mode: {FileCleaner.CleanMode}");

// Do a check for the same input/output path
if (FileSystem.InputPaths.Any(x => x.Equals(FileSystem.OutputPath)))
Expand Down

0 comments on commit 2b346c8

Please sign in to comment.