diff --git a/QModManager/Patching/Patcher.cs b/QModManager/Patching/Patcher.cs index cda791fd..519e6b30 100644 --- a/QModManager/Patching/Patcher.cs +++ b/QModManager/Patching/Patcher.cs @@ -65,7 +65,8 @@ internal static void Patch() try { - Logger.Info($"Folder structure:{IOUtilities.GetFolderStructureAsTree()}"); + Logger.Info($"Folder structure:"); + IOUtilities.LogFolderStructureAsTree(); } catch (Exception e) { diff --git a/QModManager/Utility/IOUtilities.cs b/QModManager/Utility/IOUtilities.cs index c75d1a52..c578cfc5 100644 --- a/QModManager/Utility/IOUtilities.cs +++ b/QModManager/Utility/IOUtilities.cs @@ -22,13 +22,13 @@ internal static class IOUtilities "steam_shader_cache", }; - internal static string GetFolderStructureAsTree(string directory = null) + internal static void LogFolderStructureAsTree(string directory = null) { try { directory ??= Environment.CurrentDirectory; - return GenerateFolderStructure(directory); + GenerateFolderStructure(directory); } catch (Exception e) { @@ -36,17 +36,22 @@ internal static string GetFolderStructureAsTree(string directory = null) } } - internal static string GenerateFolderStructure(string directory) + internal static void GenerateFolderStructure(string directory) { var builder = new StringBuilder(); + try { builder.AppendLine(); builder.AppendLine($"+ {new DirectoryInfo(directory).Name}"); + Logger.Info(builder.ToString()); + builder.Clear(); foreach (string dir in Directory.GetDirectories(directory)) { GetFolderStructureRecursively(builder, dir, 0); + Logger.Info(builder.ToString()); + builder.Clear(); } string[] files = Directory.GetFiles(directory); @@ -60,7 +65,7 @@ internal static string GenerateFolderStructure(string directory) } builder.AppendLine(); - return builder.ToString(); + Logger.Info(builder.ToString()); } catch (Exception e) {