summaryrefslogtreecommitdiff
path: root/src/StardewModdingAPI/Program.cs
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <github@jplamondonw.com>2017-07-02 18:27:22 -0400
committerJesse Plamondon-Willard <github@jplamondonw.com>2017-07-02 18:27:22 -0400
commitf698352718d0f5461a41758ee99c2a85893e6390 (patch)
tree6068928cd37b603124f513cdb8ed346e14e8725d /src/StardewModdingAPI/Program.cs
parentf904b3da9728ee51c76e95915b78623a7638de26 (diff)
downloadSMAPI-f698352718d0f5461a41758ee99c2a85893e6390.tar.gz
SMAPI-f698352718d0f5461a41758ee99c2a85893e6390.tar.bz2
SMAPI-f698352718d0f5461a41758ee99c2a85893e6390.zip
tweak trace logging when loading mods
Diffstat (limited to 'src/StardewModdingAPI/Program.cs')
-rw-r--r--src/StardewModdingAPI/Program.cs18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/StardewModdingAPI/Program.cs b/src/StardewModdingAPI/Program.cs
index e7cc77ef..37b821ef 100644
--- a/src/StardewModdingAPI/Program.cs
+++ b/src/StardewModdingAPI/Program.cs
@@ -587,28 +587,31 @@ namespace StardewModdingAPI
{
void TrackSkip(IModMetadata mod, string reasonPhrase) => skippedMods[mod] = reasonPhrase;
- int modsLoaded = 0;
AssemblyLoader modAssemblyLoader = new AssemblyLoader(Constants.TargetPlatform, this.Monitor);
AppDomain.CurrentDomain.AssemblyResolve += (sender, e) => modAssemblyLoader.ResolveAssembly(e.Name);
foreach (IModMetadata metadata in mods)
{
+ // get basic info
+ IManifest manifest = metadata.Manifest;
+ string assemblyPath = metadata.Manifest.EntryDll != null
+ ? Path.Combine(metadata.DirectoryPath, metadata.Manifest.EntryDll)
+ : null;
+ this.Monitor.Log(assemblyPath != null
+ ? $"Loading {metadata.DisplayName} from {assemblyPath.Replace(Constants.ModPath, "").TrimStart(Path.DirectorySeparatorChar)}..."
+ : $"Loading {metadata.DisplayName}...", LogLevel.Trace);
+
// validate status
if (metadata.Status == ModMetadataStatus.Failed)
{
- this.Monitor.Log($"Skipped {metadata.DisplayName}...", LogLevel.Trace);
+ this.Monitor.Log($" Failed: {metadata.Error}", LogLevel.Trace);
TrackSkip(metadata, metadata.Error);
continue;
}
- // get basic info
- IManifest manifest = metadata.Manifest;
- string assemblyPath = Path.Combine(metadata.DirectoryPath, metadata.Manifest.EntryDll);
-
// preprocess & load mod assembly
Assembly modAssembly;
try
{
- this.Monitor.Log($"Loading {metadata.DisplayName} from {assemblyPath.Replace(Constants.ModPath, "").TrimStart(Path.DirectorySeparatorChar)}...", LogLevel.Trace);
modAssembly = modAssemblyLoader.Load(assemblyPath, assumeCompatible: metadata.Compatibility?.Compatibility == ModCompatibilityType.AssumeCompatible);
}
catch (IncompatibleInstructionException ex)
@@ -672,7 +675,6 @@ namespace StardewModdingAPI
// track mod
metadata.SetMod(mod);
this.ModRegistry.Add(metadata);
- modsLoaded++;
}
catch (Exception ex)
{