Skip to content

Commit cc5bf85

Browse files
committed
Fix some output not being filtered by loglevel
1 parent 37954f4 commit cc5bf85

1 file changed

Lines changed: 16 additions & 8 deletions

File tree

‎TACTSharp/GroupIndex.cs‎

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,15 @@ private struct IndexEntry
2020

2121
public string Generate(CDN CDN, Settings Settings, string? hash, string[] archives, bool allowPartial = false)
2222
{
23-
if (string.IsNullOrEmpty(hash))
24-
Console.WriteLine("Generating group index for unknown group-index");
25-
else
26-
Console.WriteLine("Generating group index for " + hash);
23+
if (Settings.LogLevel <= TSLogLevel.Info)
24+
{
25+
if (string.IsNullOrEmpty(hash))
26+
Console.WriteLine("Generating group index for unknown group-index");
27+
else
28+
Console.WriteLine("Generating group index for " + hash);
2729

28-
Console.WriteLine("Loading " + archives.Length + " index files");
30+
Console.WriteLine("Loading " + archives.Length + " index files");
31+
}
2932

3033
Parallel.For(0, archives.Length, archiveIndex =>
3134
{
@@ -83,11 +86,16 @@ public string Generate(CDN CDN, Settings Settings, string? hash, string[] archiv
8386
}
8487
});
8588

86-
Console.WriteLine("Done loading index files, got " + Entries.Count + " entries");
89+
if (Settings.LogLevel <= TSLogLevel.Info)
90+
Console.WriteLine("Done loading index files, got " + Entries.Count + " entries");
91+
92+
if (Settings.LogLevel <= TSLogLevel.Info)
93+
Console.WriteLine("Sorting entries by EKey");
8794

88-
Console.WriteLine("Sorting entries by EKey");
8995
Entries.Sort((a, b) => a.EKey.AsSpan().SequenceCompareTo(b.EKey));
90-
Console.WriteLine("Done sorting entries");
96+
97+
if (Settings.LogLevel <= TSLogLevel.Info)
98+
Console.WriteLine("Done sorting entries");
9199

92100
var outputFooter = new IndexFooter
93101
{

0 commit comments

Comments
 (0)