Skip to content

Commit

Permalink
Create custom loggers for patchers
Browse files Browse the repository at this point in the history
  • Loading branch information
jan-bures committed Jan 12, 2024
1 parent 0dda6f2 commit 64ac3ef
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/SpaceWarp.Preload/API/BasePatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public abstract class BasePatcher : IPatcher
/// <summary>
/// Logger for the patcher.
/// </summary>
protected internal ManualLogSource Logger => Entrypoint.LogSource;
protected internal ManualLogSource Logger;

/// <inheritdoc/>
public abstract IEnumerable<string> DLLsToPatch { get; }
Expand Down
1 change: 1 addition & 0 deletions src/SpaceWarp.Preload/Entrypoint.cs
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ private static void AddPatchersFromDLL(string dllPath)
LogSource.LogInfo($"Found patcher: {patcherType.Name}");
var loadedAsm = Assembly.LoadFile(dllPath);
var patcher = (BasePatcher)Activator.CreateInstance(loadedAsm.GetType(patcherType.FullName));
patcher.Logger = Logger.CreateLogSource(patcherType.Name);
Patchers.Add(patcher);
}
}
Expand Down

0 comments on commit 64ac3ef

Please sign in to comment.