Skip to content

Commit bfbfc44

Browse files
committed
Feature: Replace console logs with Logger utility.
1 parent 8436b87 commit bfbfc44

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

CodeIngestLib/CodeIngestLib.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,8 @@
66
<Company>Dean Edis (DeanTheCoder)</Company>
77
</PropertyGroup>
88

9+
<ItemGroup>
10+
<ProjectReference Include="..\DTC.Core\CSharp.Core\CSharp.Core.csproj" />
11+
</ItemGroup>
12+
913
</Project>

CodeIngestLib/Ingester.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
using System.IO;
1414
using System.Linq;
1515
using System.Text;
16+
using CSharp.Core;
1617

1718
namespace CodeIngestLib;
1819

@@ -44,7 +45,7 @@ public Ingester(IngestOptions options)
4445
catch (Exception ex)
4546
{
4647
didError = true;
47-
Console.WriteLine($"Warning: Failed to read directory {d.FullName}: {ex.Message}");
48+
Logger.Instance.Error($"Failed to read directory {d.FullName}: {ex.Message}");
4849
return [];
4950
}
5051
}))
@@ -53,13 +54,13 @@ public Ingester(IngestOptions options)
5354

5455
if (didError)
5556
{
56-
Console.WriteLine("Error collecting files.");
57+
Logger.Instance.Error("Error collecting files.");
5758
return null;
5859
}
5960

6061
if (sourceFiles.Count == 0)
6162
{
62-
Console.WriteLine("No matching files found. Check your filters or directory paths.");
63+
Logger.Instance.Warn("No matching files found. Check your filters or directory paths.");
6364
return (0, 0);
6465
}
6566

@@ -87,7 +88,7 @@ public Ingester(IngestOptions options)
8788
}
8889

8990
if (m_options.Verbose)
90-
Console.WriteLine($"{kvp.Key} ({lines.Sum(o => o.Length):N0} characters -> {lines.Count:N0} lines)");
91+
Logger.Instance.Warn($"{kvp.Key} ({lines.Sum(o => o.Length):N0} characters -> {lines.Count:N0} lines)");
9192
}
9293
}
9394

0 commit comments

Comments
 (0)