feat: all pretty log

This commit is contained in:
tresabhi committed 2025-03-21 16:20:39 -05:00
1 parent 62fb80dddc
commit 9b45f21457
5 files changed
+24 -20

No files matched your search

+4 -4
View File
@@ -181,11 +181,11 @@ namespace BlitzKit.CLI.Functions
foreach (var duplicate in duplicates)
{
Console.WriteLine($"{duplicate.Key}:");
PrettyLog.Log($"{duplicate.Key}:");
foreach (var tank in duplicate.Value)
{
Console.WriteLine($"\t{tank.Id}");
PrettyLog.Log($"\t{tank.Id}");
}
if (duplicate.Value.Count == 2 && duplicate.Value.Any(tank => tank.Id.EndsWith("TU")))
@@ -215,10 +215,10 @@ namespace BlitzKit.CLI.Functions
foreach (var tank in duplicate.Value)
{
Console.WriteLine($"\t\t{tank.Slug}");
PrettyLog.Log($"\t\t{tank.Slug}");
}
Console.WriteLine();
PrettyLog.Line();
}
}
+5 -5
View File
@@ -56,7 +56,7 @@ namespace BlitzKit.CLI.Functions
DlcManifest manifest = await FetchManifest(CONTENT_GROUP, contentBuildId);
Console.WriteLine($"Downloading {manifest.PakFiles.Count} containers...");
PrettyLog.Log($"Downloading {manifest.PakFiles.Count} containers...");
int done = 0;
foreach (var pakFile in manifest.PakFiles)
@@ -70,10 +70,10 @@ namespace BlitzKit.CLI.Functions
File.WriteAllBytes(localContainerPath, bytes);
done++;
Console.WriteLine($"Downloaded {done}/{manifest.PakFiles.Count} containers...");
PrettyLog.Log($"Downloaded {done}/{manifest.PakFiles.Count} containers...");
}
Console.WriteLine("Moving pre-bundled containers...");
PrettyLog.Log("Moving pre-bundled containers...");
foreach (
var file in Directory.GetFiles(Path.Combine(TEMP_DEPOT_DIR, "Blitz/Content/Paks"), "*.pak")
)
@@ -81,13 +81,13 @@ namespace BlitzKit.CLI.Functions
File.Move(file, Path.Combine(CONTAINERS_PATH, Path.GetFileName(file)));
}
Console.WriteLine("Deleting depot...");
PrettyLog.Log("Deleting depot...");
Directory.Delete(TEMP_DEPOT_DIR, true);
}
public static async Task<DlcManifest> FetchManifest(string group, string build)
{
Console.WriteLine($"Fetching manifest for group {group} and build {build}");
PrettyLog.Log($"Fetching manifest for group {group} and build {build}");
string url =
$"{WG_DLC_DOMAIN}/dlc/{group}/dlc/BuildManifest-{BUILD_MANIFEST_OS}-{build}.json";
+2 -2
View File
@@ -99,7 +99,7 @@ namespace BlitzKit.CLI.Models
// flush BEFORE going over limit
if (changesSize + change.Content.Count > MAX_TREE_SIZE || changes.Count + 1 > MAX_FILE_COUNT)
{
Console.WriteLine("Flushing backlog...");
PrettyLog.Log("Flushing backlog...");
await Flush();
}
@@ -144,7 +144,7 @@ namespace BlitzKit.CLI.Models
await Task.Delay((int)Math.Max(0, TIME_BETWEEN_BLOBS - stopwatch.ElapsedMilliseconds));
Console.WriteLine($"blobbed {change.Path} (+{stopwatch.ElapsedMilliseconds}ms)");
PrettyLog.Success($"Blobbed {change.Path} (+{stopwatch.ElapsedMilliseconds}ms)");
newTree.Tree.Add(
new()
+4 -4
View File
@@ -51,13 +51,13 @@ namespace BlitzKit.CLI.Utils
if (File.Exists(filePath))
{
Console.WriteLine($"Oodle found at {filePath}; using that");
PrettyLog.Success($"Oodle found at {filePath}; using that");
OodleHelper.Initialize(filePath);
return;
}
Console.WriteLine(
PrettyLog.Log(
$"Oodle not found; downloading to {filePath} from {url} and extracting {entry}"
);
@@ -106,11 +106,11 @@ namespace BlitzKit.CLI.Utils
if (File.Exists(filePath))
{
Console.WriteLine($"Zlib found at {filePath}; using that");
PrettyLog.Success($"Zlib found at {filePath}; using that");
}
else
{
Console.WriteLine($"Zlib not found; downloading to {filePath} from {url}");
PrettyLog.Log($"Zlib not found; downloading to {filePath} from {url}");
ZlibHelper.DownloadDll(filePath, url);
}
+9 -5
View File
@@ -4,35 +4,39 @@ namespace BlitzKit.CLI.Utils
{
public static void Log(string message)
{
Console.WriteLine(message);
Console.WriteLine($"[LOG] {message}");
}
public static void Warn(string message)
{
Console.ForegroundColor = ConsoleColor.Yellow;
Console.WriteLine(message);
Console.WriteLine($"[WARN] {message}");
Console.ResetColor();
}
public static void Error(string message)
{
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine(message);
Console.WriteLine($"[ERROR] {message}");
Console.ResetColor();
}
public static void Success(string message)
{
Console.ForegroundColor = ConsoleColor.Green;
Console.WriteLine(message);
Console.WriteLine($"[SUCCESS] {message}");
Console.ResetColor();
}
public static void Background(string message)
{
Console.ForegroundColor = ConsoleColor.DarkGray;
Console.WriteLine(message);
Console.WriteLine($"[BACKGROUND] {message}");
Console.ResetColor();
}
public static void Line() {
Console.WriteLine();
}
}
}