summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/SMAPI/Framework/ModLoading/AssemblyLoader.cs3
-rw-r--r--src/SMAPI/Program.cs19
2 files changed, 11 insertions, 11 deletions
diff --git a/src/SMAPI/Framework/ModLoading/AssemblyLoader.cs b/src/SMAPI/Framework/ModLoading/AssemblyLoader.cs
index ccbd053e..7dcf94bf 100644
--- a/src/SMAPI/Framework/ModLoading/AssemblyLoader.cs
+++ b/src/SMAPI/Framework/ModLoading/AssemblyLoader.cs
@@ -270,9 +270,10 @@ namespace StardewModdingAPI.Framework.ModLoading
break;
case InstructionHandleResult.NotCompatible:
+ this.Monitor.LogOnce(loggedMessages, $"{logPrefix}Broken code in {filename}: {handler.NounPhrase}.");
if (!assumeCompatible)
throw new IncompatibleInstructionException(handler.NounPhrase, $"Found an incompatible CIL instruction ({handler.NounPhrase}) while loading assembly {filename}.");
- this.Monitor.LogOnce(loggedMessages, $"{logPrefix}Found an incompatible CIL instruction ({handler.NounPhrase}) while loading assembly {filename}, but SMAPI is configured to allow it anyway. The mod may crash or behave unexpectedly.", LogLevel.Warn);
+ this.Monitor.LogOnce(loggedMessages, $"{logPrefix}Found broken code ({handler.NounPhrase}) while loading assembly {filename}, but SMAPI is configured to allow it anyway. The mod may crash or behave unexpectedly.", LogLevel.Warn);
break;
case InstructionHandleResult.DetectedGamePatch:
diff --git a/src/SMAPI/Program.cs b/src/SMAPI/Program.cs
index 47db8e86..acab8c70 100644
--- a/src/SMAPI/Program.cs
+++ b/src/SMAPI/Program.cs
@@ -674,8 +674,8 @@ namespace StardewModdingAPI
{
this.Monitor.Log("Loading mods...", LogLevel.Trace);
- IDictionary<IModMetadata, string> skippedMods = new Dictionary<IModMetadata, string>();
- void TrackSkip(IModMetadata mod, string reasonPhrase) => skippedMods[mod] = reasonPhrase;
+ IDictionary<IModMetadata, string[]> skippedMods = new Dictionary<IModMetadata, string[]>();
+ void TrackSkip(IModMetadata mod, string userReasonPhrase, string devReasonPhrase = null) => skippedMods[mod] = new[] { userReasonPhrase, devReasonPhrase };
// load content packs
foreach (IModMetadata metadata in mods.Where(p => p.IsContentPack))
@@ -746,17 +746,17 @@ namespace StardewModdingAPI
}
catch (IncompatibleInstructionException ex)
{
- TrackSkip(metadata, $"it's no longer compatible (detected {ex.NounPhrase}). Please check for a newer version of the mod.");
+ TrackSkip(metadata, "it's no longer compatible. Please check for a newer version of the mod.");
continue;
}
catch (SAssemblyLoadFailedException ex)
{
- TrackSkip(metadata, $"its DLL '{manifest.EntryDll}' couldn't be loaded: {ex.Message}");
+ TrackSkip(metadata, $"it DLL couldn't be loaded: {ex.Message}");
continue;
}
catch (Exception ex)
{
- TrackSkip(metadata, $"its DLL '{manifest.EntryDll}' couldn't be loaded:\n{ex.GetLogSummary()}");
+ TrackSkip(metadata, "its DLL couldn't be loaded.", $"Error: {ex.GetLogSummary()}");
continue;
}
@@ -816,12 +816,11 @@ namespace StardewModdingAPI
foreach (var pair in skippedMods.OrderBy(p => p.Key.DisplayName))
{
IModMetadata mod = pair.Key;
- string reason = pair.Value;
+ string[] reason = pair.Value;
- if (mod.Manifest?.Version != null)
- this.Monitor.Log($" {mod.DisplayName} {mod.Manifest.Version} because {reason}", LogLevel.Error);
- else
- this.Monitor.Log($" {mod.DisplayName} because {reason}", LogLevel.Error);
+ this.Monitor.Log($" {mod.DisplayName}{(mod.Manifest?.Version != null ? " " + mod.Manifest.Version.ToString() : "")} because {reason[0]}", LogLevel.Error);
+ if (reason[1] != null)
+ this.Monitor.Log($" {reason[1]}", LogLevel.Trace);
}
this.Monitor.Newline();
}