sarbian / ModuleManager

176 stars 96 forks source link

ENHANCEMENT: Informative Log Labeling #162

Open 7ranceaddic7 opened 4 years ago

7ranceaddic7 commented 4 years ago

So, all too often we see log entries like this ...

[LOG 19:26:20.919] Applying update WarpPlugin/Patches/OreTanksFix/@PART[*]:FINAL to Squad/Parts/Engine/liquidEngineLV-909_v2/liquidEngineLV-909_v2.cfg/PART[liquidEngine3_v2]
[LOG 19:26:20.920] Applying update WarpPlugin/Patches/OreTanksFix/@PART[*]:FINAL to Squad/Parts/Engine/liquidEngineLV-N/liquidEngineLV-N.cfg/PART[nuclearEngine]
[LOG 19:26:20.920] Applying update WarpPlugin/Patches/OreTanksFix/@PART[*]:FINAL to Squad/Parts/Engine/liquidEngineLV-N/liquidEngineLV-N.cfg/PART[nuclearEngine-trimodal]
[LOG 19:26:20.921] Applying update WarpPlugin/Patches/OreTanksFix/@PART[*]:FINAL to Squad/Parts/Engine/liquidEngineLV-T30/liquidEngineLV-T30.cfg/PART[liquidEngine]

And, yes, that has the necessary information available to decipher who is doing what.

Now, I know some already do this in their logging, but I'm sure that's more plugin.dll doing the heavy lifting. I also know it's an ask to get EVERY Modder to alter their ways in a meaningful and consistent manner, in the short-term. So, I'm wondering if there is a programmatic solution, between now and widespread adoption, that MM can implement which would produce a log entry like ...

[LOG 19:26:20.919] [KSP Interstellar Extended]: Applying update WarpPlugin/Patches/OreTanksFix/@PART[*]:FINAL to Squad/Parts/Engine/liquidEngineLV-909_v2/liquidEngineLV-909_v2.cfg/PART[liquidEngine3_v2]
[LOG 19:26:20.920] [KSP Interstellar Extended]: Applying update WarpPlugin/Patches/OreTanksFix/@PART[*]:FINAL to Squad/Parts/Engine/liquidEngineLV-N/liquidEngineLV-N.cfg/PART[nuclearEngine]
[LOG 19:26:20.920] [KSP Interstellar Extended]: Applying update WarpPlugin/Patches/OreTanksFix/@PART[*]:FINAL to Squad/Parts/Engine/liquidEngineLV-N/liquidEngineLV-N.cfg/PART[nuclearEngine-trimodal]
[LOG 19:26:20.921] [KSP Interstellar Extended]: Applying update WarpPlugin/Patches/OreTanksFix/@PART[*]:FINAL to Squad/Parts/Engine/liquidEngineLV-T30/liquidEngineLV-T30.cfg/PART[liquidEngine]

This would provide a boon to those of us trying to provide some semblance of support and lift an all too often singular burden placed on mod developers.

blowfishpro commented 4 years ago

I'm not aware of any straightforward way to map individual patches to the name of a mod. There might be .verison files indicating ownership of a particular directory in some cases, but that's not 100% reliable as not all mods have them and some mods share directories.

7ranceaddic7 commented 4 years ago

Yeah, that's what I was thinking, pulling the info from the .version files.

Anyone rep'd on CKAN or sporting KSP-AVC already makes that info accessible. And, (I think) that is where the first two sigmas reside; so, that's what almost 70% of mods. Not a bad start. For those who only host on SpaceDock, I would think MM could draw the location from where the mod is announcing itself.

EXAMPLE: (just roll with it)

\GameData\DMagicUtilities\CapCom\ \GameData\DMagicUtilities\ContractParser\ \GameData\DMagicUtilities\ContractsWindow\ \GameData\DMagicUtilities\ProgressParser\

Would log like this:

[DMagicUtilities\CapCom] [DMagicUtilities\ContractParser] [DMagicUtilities\ContractsWindow] [DMagicUtilities\ProgressParser]

If DMagic didn't have a .version, MM could hold on to the directory info at the time it read the config file. Then, as it processed those configs, it could prepend the log entry with the stored 'dirstr'.

IANAP can only meander my way through a log connecting dots after the fact, so maybe I'm just tokin' some thinking this wouldn't be all that much of a challenge.

Because ya know ...

Click to expand! ![XKCD1270](https://imgs.xkcd.com/comics/functional.png)