File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed
Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ public class ModLogger : IBasicLogger
99 {
1010 internal static readonly K . Logger LOG = K . Logger . CreateThreadUnsafeForType < ModuleManager > ( ) ; // No need to use thread safe logging. Yet.
1111 internal static readonly ModLogger Instance = new ModLogger ( ) ; // For legacy code
12+ internal static bool DebugMode => KSPe . Globals < ModuleManager > . DebugMode ;
1213
1314 private delegate void LogMethod ( string message , params object [ ] @parms ) ;
1415 private readonly LogMethod [ ] methods ;
Original file line number Diff line number Diff line change @@ -198,12 +198,14 @@ public IEnumerable<IProtoUrlConfig> Run()
198198 // But...
199199 // Now I see the reason this was done this way. Asking the user to send KSP.log is tricky by itself, and
200200 // sending more than one log is yet more troublesome.
201- // What I can do is to only dump this on KSP.log when the KSPe.Util.Log.Level is bigger than Info .
201+ // What I can do is to only dump this on KSP.log when the the KSPe Globals for ModuleManager has Debug set to true .
202202 // (the default KSPe's Global for Module Manager as from KSPe 2.2.3)
203203 string patchLogPath = KSPe . IO . File < Startup > . Data . Solve ( FilePathRepository . PATCH_LOG_FILENAME + ".log" ) ;
204204 if ( File . Exists ( patchLogPath ) )
205205 {
206- if ( ModLogger . LOG . level > KSPe . Util . Log . Level . INFO )
206+ #pragma warning disable CS0618 // Type or member is obsolete
207+ if ( ModuleManager . IsLoadedFromCache && ModLogger . DebugMode )
208+ #pragma warning restore CS0618 // Type or member is obsolete
207209 {
208210 logger . Info ( "Dumping patch log" ) ;
209211 logger . Info ( "\n #### BEGIN PATCH LOG ####\n \n \n " + File . ReadAllText ( patchLogPath ) + "\n \n \n #### END PATCH LOG ####" ) ;
You can’t perform that action at this time.
0 commit comments