Better logging

This commit is contained in:
Evil Factory
2026-03-01 13:09:05 -03:00
parent 22a74bf1fd
commit 9ee4728e2a
3 changed files with 21 additions and 6 deletions
@@ -348,7 +348,7 @@ class LuaScriptManagementService : ILuaScriptManagementService, ILuaDataService
return FluentResults.Result.Fail("Tried to execute Lua scripts without unloading first.");
}
_loggerService.LogMessage("Executing Lua scripts");
_loggerService.LogMessage("[Lua] Executing scripts");
SetupEnvironment(enableSandbox);
@@ -373,7 +373,7 @@ class LuaScriptManagementService : ILuaScriptManagementService, ILuaDataService
{
try
{
_loggerService.LogMessage($"Run {filePath.Value}");
_loggerService.LogMessage($"[Lua] - Run {filePath.Value}");
_script.Call(_script.LoadFile(filePath.FullPath), resource.OwnerPackage.Dir);
}
catch(Exception e)
@@ -356,6 +356,8 @@ public class PluginManagementService : IAssemblyManagementService
{
return FluentResults.Result.Ok();
}
_logger.LogMessage($"Activating {nameof(IAssemblyPlugin)} instances");
var loadedPackagePlugins =
ImmutableArray.CreateBuilder<(ContentPackage Package, ImmutableArray<IAssemblyPlugin> Plugins)>();
@@ -368,6 +370,7 @@ public class PluginManagementService : IAssemblyManagementService
{
try
{
_logger.LogMessage($"- Instantiating {pluginType.Name}");
var plugin = (IAssemblyPlugin)Activator.CreateInstance(pluginType);
_pluginInjectorContainer.InjectProperties(plugin);
_pluginInjectorContainer.Register(pluginType, fac => plugin);
@@ -579,9 +582,7 @@ public class PluginManagementService : IAssemblyManagementService
continue;
}
#if DEBUG
_logger.Log($"[DEBUG] Compiling assembly for {scripts.Key}, in ContentPackage {contentPackRes.Key.Name}");
#endif
_logger.LogMessage($"Compiling assembly for {scripts.Key}, in ContentPackage {contentPackRes.Key.Name}");
result.WithReasons(assemblyLoader.CompileScriptAssembly(
assemblyName: scripts.Key,