Jump to content

[1.8+] KSPBugReport : Easy issue/bug reporting plugin


Gotmachine

Recommended Posts

KSPBugReport

Issue and bug reporting plugin for KSP players

This small plugin adds a "bug report" menu to the KSP debug menu (opened with ALT+F12).

That menu provide a way for players to create a zipped bug report containing the KSP logs and game database dumps usually needed by mod authors when they need to troubleshot bugs and issues.

It also include an option to automatically upload the bug report to an online file sharing service.

screenshot

Dowload and installation

Compatible with KSP 1.8+

KSPBugReport is available on CKAN (recommended)

For manual installation :

  • Go to the GitHub release page and download the file named KSPBugReport_x.x.x_KSP1.8+.zip
  • Open the downloaded *.zip archive
  • Copy the KSPBugReport folder found in the archive into the GameData folder of your KSP installation.

How to use

  • Try to reproduce your issue or bug, in order for KSP to log information about what happened.
  • Press ALT+F12
  • In the Bug Report section, click on Create report. This will create a zip archive on your desktop. You can open the location of that zip file in your file explorer by clicking on Open report folder.
  • If you want to add screenshots to your report, open/position what you want to show and click on Add screenshot to last report. The debug menu window won't appear on the screenshot. You can add multiple screenshots.
  • To upload the report to a file sharing service, click on Upload last report. Once uploaded, the download link to your report will be copied to the clipboard and you can paste it elsewhere (forum post, github, discord...). In case you loose the copied link, you can copy it to the clipboard again by clicking on Copy last upload link to clipboard.

Disclaimer

This plugin will upload information about your computer specs, your KSP install and your current game on the internet, on public file sharing services.

The KSP logs don't contain any sensitive information. However, be aware that :

  • The KSP.log file contain the path to your KSP install, which can contain the user name for your computer (for example C:\Users\MyUserName\...\KSP\). This is usually not a security issue, but if you want to avoid that, move your KSP folder to another path (for example C:\Games\KSP\).
  • The KSP.log file contain everything that is logged by your mods/plugins. An ill-intentioned mod author can potentially access any file on your computer and dump sensitive information in the KSP logs.
  • Your savegame is included in the report, with everything that you can write and save in KSP (vessel names and descriptions for example)

Notes :

  • Bug reports will contain :
    • The KSP.log file
    • The modulemanager.configcache file, or if not found a Configs.txt file generated from the live game database
    • A *.sfs savegame generated from the currently loaded game (if any)
    • The Logs\Kopernicus body configs dumps (if present)
  • Available upload services :
    • Primary : https://oshi.at (90 days retention, unlimited downloads)
    • Secondary : https://0x0.st (30 days minimum retention, max 1 year depending on file size, unlimited downloads)
    • Tertiary : https://file.io (14 days retention, file deleted after the first download)
  • Zip compression is done through the System.IO.Compression mono library as provided in the Unity 2019.2.2f1 editor download in Editor\Data\MonoBleedingEdge\lib\mono\4.5

License

MIT

Edited by Gotmachine
Link to comment
Share on other sites

Great idea!!!
 

A number of mods, including ModuleManager and my newer mods, add logs t9 the Logs directory,  wh6 not include everything from that directory instead of just Kopernicus?

Also, the Player.log is also needed, I find it more useful than the KSP.log

Edited by linuxgurugamer
Link to comment
Share on other sites

2 hours ago, linuxgurugamer said:

A number of mods, including ModuleManager and my newer mods, add logs t9 the Logs directory,  wh6 not include everything from that directory instead of just Kopernicus?

Because contrary to KSP.log, that folder is never cleared, so it can (and will) become huge and full of irrelevant logs from mods that might not even be installed anymore.
Also, Kopernicus has the bad taste to dump a ton of stuff in there (including a copy of the KSP.log and modulemanager.configcache, etc) and also generate a zip containing those in there, that's why I only get the body configs dumps from Logs\Kopernicus, not the whole folder.
I really don't understand why modders feel the need to do some separate logging. I find it counterproductive, as it is critical IMO to be able to replace a log entry in the execution flow of everything else.

2 hours ago, linuxgurugamer said:

Also, the Player.log is also needed, I find it more useful than the KSP.log

KSP.log has the timestamps, the [ERR, [EXC, [WRN prefixes, is much more readable and has the stacktraces on errors/exceptions.
Does a stacktrace on a random log entry really help debug anything ? If you need a stacktrace for your debugging needs, I personally use the following helper method  :

[Conditional("DEBUG")]
public static void LogDebugStack(string message)
{
	System.Diagnostics.StackTrace stackTrace = new System.Diagnostics.StackTrace();
	UnityEngine.Debug.Log(message + "\n" + stackTrace.ToString());
}

Anyway, the issue is that player.log is often huge (100mb+ compressed player.log aren't that uncommon), which is a problem for being able to share those reports.

Edited by Gotmachine
Link to comment
Share on other sites

1 hour ago, Gotmachine said:

KSP.log has the timestamps, the [ERR, [EXC, [WRN prefixes, is much more readable and has the stacktraces on errors/exceptions.
Does a stacktrace on a random log entry really help debug anything ? If you need a stacktrace for your debugging needs, I personally use the following helper method  :

Yes.

KSP.log is the.. .KSP's log. :)

The Player.log is where Unity does its logging. Crashes and other inner problems are only logged on the Player.log.

Granted, it's not needed every time. Perhaps as an option?

Link to comment
Share on other sites

4 minutes ago, Lisias said:

Crashes and other inner problems are only logged on the Player.log.

That plugin is useless in the case of a hard crash, anyway.
And I have serious doubts that there is a single extra line in Player.log vs KSP.log.
KSP.log is just an extra callback for the default Unity log handler.
The only extra stuff in Player.log are the stacktraces, which are discarded for the "Log", "Assert" and "Warning" logging levels in KSP.log (but not for the "Error" and "Exception" levels).

Link to comment
Share on other sites

Just now, Gotmachine said:

That plugin is useless in the case of a hard crash, anyway.

Point taken...

1 minute ago, Gotmachine said:

And I have serious doubts that there is a single extra line in Player.log vs KSP.log.
KSP.log is just an extra callback for the default Unity log handler.

That it's used only by KSP. Unity still uses the original handler - so any problems inside Unity are only logged on the Player.log .

But your argument that crashes renders your plugin useless is right - anything really needing the Player.log would be better handled externally, as on CKAN perhaps.

Link to comment
Share on other sites

  • 1 year later...
On 3/21/2021 at 2:57 PM, Gotmachine said:

And I have serious doubts that there is a single extra line in Player.log vs KSP.log.

There's something else up with this file, too - because I don't have one anywhere on my F: drive, and there are 6 KSP installs there (1.12.2 and .3). I've actually never had a player.log file and I've been playing KSP since 1.7.

Link to comment
Share on other sites

3 hours ago, OrbitalManeuvers said:

There's something else up with this file, too - because I don't have one anywhere on my F: drive, and there are 6 KSP installs there (1.12.2 and .3). I've actually never had a player.log file and I've been playing KSP since 1.7.

How to find the log files is detailed in this post - they were moved in later versions of KSP:

 

Link to comment
Share on other sites

I thought about integrating this into the Kopernicus error dialog, but decided I don't want to deal with the extra webconnect warnings in my post.

Either way I'll be shooting people who can't gather logs this way quite a bit.  Cheers for making this.

Link to comment
Share on other sites

On 3/21/2021 at 8:41 PM, Gotmachine said:

Because contrary to KSP.log, that folder is never cleared, so it can (and will) become huge and full of irrelevant logs from mods that might not even be installed anymore

Which directory is that? I somehow feel, that after playing KSP several years, i guess, i could do some clean up an delete old accumulated logs?!

Maybe a autocleaner would be something for the KSPCF ?!

Link to comment
Share on other sites

1 hour ago, Rakete said:

Maybe a autocleaner would be something for the KSPCF ?!

These logs are usually in the "Logs" folder, but there is no rule here, some mods can use a different folder.
And no, while I disagree with the "separate logging" practice, I won't touch what other mods are doing, it's their responsibility, not mine.
Beside, there is a also a valid use case for keeping around "one-time" logs that are only generated the first time a mod is installed (like the MM patching log for example).

Link to comment
Share on other sites

1 hour ago, linuxgurugamer said:

They get deleted next time game is run, but yes, you can delete the log files if not needed

Now i am confused. Whats right? Does it become cleared or does it not? Gotmachine says different...

On 3/21/2021 at 8:41 PM, Gotmachine said:

Because contrary to KSP.log, that folder is never cleared, so it can (and will) become huge and full of irrelevant logs from mods that might not even be installed anymore

 

Link to comment
Share on other sites

10 minutes ago, Rakete said:

Now i am confused. Whats right? Does it become cleared or does it not? Gotmachine says different...

On 3/21/2021 at 3:41 PM, Gotmachine said:

Because contrary to KSP.log, that folder is never cleared, so it can (and will) become huge and full of irrelevant logs from mods that might not even be installed anymore

 

Ah, _those_ logs.

Yes, you can (and should) delete them occasionally

Link to comment
Share on other sites

1 hour ago, linuxgurugamer said:

Ah, _those_ logs.

Yes, you can (and should) delete them occasionally

The Logs in Steam\steamapps\common\Kerbal Space Program\Logs ? Or is there another spot, that gets cluttered with logs?

Link to comment
Share on other sites

22 hours ago, Rakete said:

The Logs in Steam\steamapps\common\Kerbal Space Program\Logs ? Or is there another spot, that gets cluttered with logs?

The KSP log(generated by KSP itself) in ththose directories get rotated.  Specifically the following happens when the game starts:

  1. Player-prev.log (if it exists) gets deleted
  2. Player.log (if it exists) gets renamed to Player-prev.log
  3. New Player.log gets written
Link to comment
Share on other sites

5 hours ago, linuxgurugamer said:

The KSP log(generated by KSP itself) in ththose directories get rotated.  Specifically the following happens when the game starts:

  1. Player-prev.log (if it exists) gets deleted
  2. Player.log (if it exists) gets renamed to Player-prev.log
  3. New Player.log gets written

Okay, seems not to need clean up actions. So which Logs get not deleted and be deleted by hand occasionally?

Link to comment
Share on other sites

7 minutes ago, linuxgurugamer said:

A number of mods store log files in a directory called Logs in the KSP directory

Okay... in my case i only found module manager and kopernicus and cleared them. Think, it should be good now.

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...