Jump to content

KSP 1.2: ksp.log vs. output_log.txt


Recommended Posts

Mod authors, including @nightingale ask for full ksp.log files when submitting issues.  My "Kerbal Space Program/ksp.log" file is being touched (date/time changes) every time I play KSP but the file is always 0 bytes.  My "Kerbal Space Program/KSP_x64_Data/output_log.txt" file has a fair bit of logging but no timestamps like what I see other posting.

 

What controls the creation and filling of KSP.log? What is output_log.txt for if it looks suspiciously like the main log but lacking timestamps? I'm running from Steam but I created a direct link to the KSP x64 EXE because I'm tired of getting asked EVERY time "do I want 32 or 64 bit".  I am not passing any command line args to KSP.  I can see some content in the KSP debug console window so I know for example that exceptions are happening.

Link to comment
Share on other sites

KSP.log is created on game startup (in the KSPLog's Awake, for those interested).  It hooks into the Unity log handlers (via the same mechanism as the debug console).  The most likely reason for it not to work would be a file-system/permission issue (could be the "current directory" on the direct link is not the KSP directory, so the file is either created elsewhere, or fails to get created).

As far as the differences (off the top of my head):

  • KSP.log is a log created by KSP, output_log.txt is created by Unity.
  • KSP.log doesn't flush automatically (it's not updated on disk immediately), although there's a setting in the debug console to force it to flush.
  • If your game crashes, the crash info is only in output_log.txt
  • KSP.log has timestamps
  • output_log.txt has extra (useless) lines.

The last point is why I always ask for KSP.log.  It's 1/4 the size (in terms of number of lines, making much easier to scan through).  But, I won't say no if a user gives me output_log.txt instead.

I don't know the reason why output_log.txt is generally preferred (@NathanKell's support thread on the matter says that KSP.log "lacks valuable information", which could be the crash details, or perhaps something else that is either no longer the case, or that I'm not aware of).

Link to comment
Share on other sites

18 hours ago, nightingale said:

KSP.log is created on game startup (in the KSPLog's Awake, for those interested).  It hooks into the Unity log handlers (via the same mechanism as the debug console).  The most likely reason for it not to work would be a file-system/permission issue (could be the "current directory" on the direct link is not the KSP directory, so the file is either created elsewhere, or fails to get created).

As far as the differences (off the top of my head):

  • KSP.log is a log created by KSP, output_log.txt is created by Unity.
  • KSP.log doesn't flush automatically (it's not updated on disk immediately), although there's a setting in the debug console to force it to flush.
  • If your game crashes, the crash info is only in output_log.txt
  • KSP.log has timestamps
  • output_log.txt has extra (useless) lines.

I don't know the reason why output_log.txt is generally preferred (@NathanKell's support thread on the matter says that KSP.log "lacks valuable information", which could be the crash details, or perhaps something else that is either no longer the case, or that I'm not aware of).

Thanks for this info!

I tracked down my problem.  I needed to include "-single-instance" on the command line to start KSP_x64.exe.  Strange "feature" to control whether it wants to populate the log even though it was regularly touch()ing or re-creating the file which requires sufficient write privileges. 

Link to comment
Share on other sites

Huh I always thought the difference was "output_log.txt rox" and "ksp.log sux". Mostly because nobody ever asked for ksp.log. I should start looking at it when troubleshooting my own mods. I really dislike the lack of timestamp in output_log.txt. That alone makes ksp.log worth another look.

Also @NeuroticGamer a lot of times Windows will misreport the sizes of files. Try to use Notepad (or Notepad++. But nothing fancier than that because Word and the like tend to grab hold of the file and disallow further writes to it) to open the file and you may be surprised to find it actually DOES contain information.

Link to comment
Share on other sites

23 hours ago, 5thHorseman said:

Also @NeuroticGamer a lot of times Windows will misreport the sizes of files. Try to use Notepad (or Notepad++. But nothing fancier than that because Word and the like tend to grab hold of the file and disallow further writes to it) to open the file and you may be surprised to find it actually DOES contain information.

Longtime Windows programmer here (actually started programming before MS-DOS was born).  I use Directory Opus instead of Windows File Manager for that very reason.  But yes, I was opening the file in Notepad++ or EditPad Pro (forget which) and it was indeed an empty file.  Hence the reason I said it was acting like Unix/Perl "touch" operation, and that requires write permissions.  

My guess is I saw some weird Unity feature related to .NET single instancing stuff.  While I haven't done a ton of .NET work, I've had to write OLE and COM interface servers with their weird instance modes...shudders just remembering that painful experience.  .NET is just modern COM but it still has a ton of legacy ideas glued on due to the giant wart that is Windows.

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...