Skip to content

Add "Export Debug info" functionality#256

Merged
ManlyMarco merged 18 commits into
IllusionMods:masterfrom
Kokaiinum:DebugInfo
Apr 30, 2026
Merged

Add "Export Debug info" functionality#256
ManlyMarco merged 18 commits into
IllusionMods:masterfrom
Kokaiinum:DebugInfo

Conversation

@Kokaiinum

Copy link
Copy Markdown
Contributor

Description

This pull request adds new entry to the Tools dropdown: "Generate Debug Info". When used, this option creates a zip in the game folder containing:

  • All output_log.txt LogOutput.log files found in the game directory and subdirectories
  • A text file enumerating a directory and file tree list of the entire game folder, with file size and last modified timestamps for the files
  • A sub-zip file containing the config and plugin directories from the game's BepInEx folder

Motivation and Context

This pull request aims to implement the functionality discussed in (and thus close) #124

How Has This Been Tested?

I tried using this feature on multiple installs of Koikatsu, Koikatsu Sunshine, AiComi and HoneyCome. It performed as expected for all four games.

Screenshots (if appropriate):

DebugInfoScreenshot2 DebugInfoScreenshot1

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

@ManlyMarco ManlyMarco left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's better to open a file save dialog instead of writing straight to game directory.

Ideally Player.log would also be collected if available to deal with doorstop log redirection being turned off. This might be out of scope of this PR though since KKM doesn't handle this at all currently

. It probably would need a log path per game dictionary in InstallDirectoryHelper to work.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new “Generate Debug Info” tool to KKManager to help users export troubleshooting artifacts from a selected game install.

Changes:

  • Adds a new Tools menu item + click handler in the main window to trigger debug-info export.
  • Introduces KKManager.Functions.DebugInfo to generate a file tree listing, collect logs, and package BepInEx config/plugins into a nested zip.
  • Updates KKManager.Core project references to support zip creation.

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 11 comments.

File Description
src/KKManager/Windows/MainWindow.cs Wires a new Tools menu click handler to start debug-info generation.
src/KKManager/Windows/MainWindow.Designer.cs Adds the new Tools dropdown menu item and event hookup.
src/KKManager.Core/KKManager.Core.csproj Adds compression-related assembly reference for the new zip feature.
src/KKManager.Core/Functions/DebugInfo.cs Implements debug-info collection and zip packaging logic.
Files not reviewed (1)
  • src/KKManager/Windows/MainWindow.Designer.cs: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/KKManager.Core/Functions/DebugInfo.cs Outdated
Comment thread src/KKManager.Core/Functions/DebugInfo.cs Outdated
Comment thread src/KKManager.Core/Functions/DebugInfo.cs Outdated
Comment thread src/KKManager.Core/Functions/DebugInfo.cs Outdated
Comment thread src/KKManager.Core/Functions/DebugInfo.cs Outdated
Comment thread src/KKManager/Windows/MainWindow.cs Outdated
Comment thread src/KKManager/Windows/MainWindow.Designer.cs Outdated
Comment thread src/KKManager.Core/KKManager.Core.csproj
Comment thread src/KKManager.Core/Functions/DebugInfo.cs Outdated
Comment thread src/KKManager.Core/Functions/DebugInfo.cs Outdated
@Kokaiinum

Copy link
Copy Markdown
Contributor Author

Added a file dialog so the user can pick the location. I didn't try to handle player.log because I agree that it's a little out of scope, and I personally don't have all of the games to be able to test the feature with them, or even determine the correct location for them.

I also addressed most of the points raised by Copilot, with two exceptions. Firstly, it's simply wrong in it's assement of the zip file structure behaviour, the current implementation already handles that correctly. Secondly, while System.IO.Compression.FileSystem isn't in the csproj, it does appear in the list of referenced assemblies in VS2022 and it's already ticked when I go to add it. I might be missing something though.

@ManlyMarco

Copy link
Copy Markdown
Collaborator

CI build is succeeding so the assembly references are correct.

@ManlyMarco ManlyMarco merged commit 0221187 into IllusionMods:master Apr 30, 2026
1 check passed
@ManlyMarco ManlyMarco linked an issue Apr 30, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add ability to gather/export debug info

3 participants