Skip to content

Commit c68005e

Browse files
committed
use logger not Console.WriteLine
1 parent 6a9b6c4 commit c68005e

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/tooling/docs-assembler/Cli/RepositoryCommands.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ public async Task<int> BuildAll(
130130
var navigation = new GlobalNavigation(assembleSources, navigationFile);
131131

132132
var pathProvider = new GlobalNavigationPathProvider(navigationFile, assembleSources, assembleContext);
133-
var htmlWriter = new GlobalNavigationHtmlWriter(navigation);
133+
var htmlWriter = new GlobalNavigationHtmlWriter(logger, navigation);
134134
var legacyPageChecker = new LegacyPageChecker();
135135
var historyMapper = new PageLegacyUrlMapper(legacyPageChecker, assembleSources.HistoryMappings);
136136

src/tooling/docs-assembler/Navigation/GlobalNavigationHtmlWriter.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,14 @@
55
using System.Collections.Concurrent;
66
using Elastic.Documentation.Site.Navigation;
77
using Elastic.Markdown.IO.Navigation;
8+
using Microsoft.Extensions.Logging;
89

910
namespace Documentation.Assembler.Navigation;
1011

11-
public class GlobalNavigationHtmlWriter(GlobalNavigation globalNavigation) : INavigationHtmlWriter
12+
public class GlobalNavigationHtmlWriter(ILoggerFactory logFactory, GlobalNavigation globalNavigation) : INavigationHtmlWriter
1213
{
14+
private readonly ILogger<Program> _logger = logFactory.CreateLogger<Program>();
15+
1316
private readonly ConcurrentDictionary<(string, int), string> _renderedNavigationCache = [];
1417

1518
public async Task<NavigationRenderResult> RenderNavigation(IRootNavigationItem<INavigationModel, INavigationItem> currentRootNavigation, int maxLevel, Cancel ctx = default)
@@ -30,10 +33,7 @@ public async Task<NavigationRenderResult> RenderNavigation(IRootNavigationItem<I
3033
};
3134
}
3235

33-
Console.WriteLine($"Rendering navigation for {lastParentBeforeRoot.NavigationTitle} ({lastParentBeforeRoot.Id})");
34-
if (lastParentBeforeRoot.NavigationTitle == "Cloud release notes")
35-
{
36-
}
36+
_logger.LogInformation("Rendering navigation for {NavigationTitle} ({Id})", lastParentBeforeRoot.NavigationTitle, lastParentBeforeRoot.Id);
3737

3838
if (lastParentBeforeRoot is not DocumentationGroup group)
3939
return NavigationRenderResult.Empty;

0 commit comments

Comments
 (0)