Update ModuleLog instantiations

This commit is contained in:
Haselnussbomber 2025-10-24 05:05:56 +02:00
parent 8633e29615
commit bb4b04f158
No known key found for this signature in database
GPG key ID: BB905BB49E7295D1
42 changed files with 48 additions and 48 deletions

View file

@ -17,7 +17,7 @@ namespace Dalamud.Console;
[ServiceManager.BlockingEarlyLoadedService("Console is needed by other blocking early loaded services.")]
internal partial class ConsoleManager : IServiceType
{
private static readonly ModuleLog Log = new("CON");
private static readonly ModuleLog Log = ModuleLog.Create<ConsoleManager>();
private Dictionary<string, IConsoleEntry> entries = [];

View file

@ -13,7 +13,7 @@ namespace Dalamud.Data;
/// </summary>
internal sealed unsafe class RsvResolver : IDisposable
{
private static readonly ModuleLog Log = new("RsvProvider");
private static readonly ModuleLog Log = ModuleLog.Create<RsvResolver>();
private readonly Hook<LayoutWorld.Delegates.AddRsvString> addRsvStringHook;

View file

@ -25,7 +25,7 @@ internal unsafe class AddonEventManager : IInternalDisposableService
/// </summary>
public static readonly Guid DalamudInternalKey = Guid.NewGuid();
private static readonly ModuleLog Log = new("AddonEventManager");
private static readonly ModuleLog Log = ModuleLog.Create<AddonEventManager>();
[ServiceManager.ServiceDependency]
private readonly AddonLifecycle addonLifecycle = Service<AddonLifecycle>.Get();

View file

@ -16,7 +16,7 @@ namespace Dalamud.Game.Addon.Events;
/// </summary>
internal unsafe class PluginEventController : IDisposable
{
private static readonly ModuleLog Log = new("AddonEventManager");
private static readonly ModuleLog Log = ModuleLog.Create<AddonEventManager>();
/// <summary>
/// Initializes a new instance of the <see cref="PluginEventController"/> class.

View file

@ -21,7 +21,7 @@ namespace Dalamud.Game.Addon.Lifecycle;
[ServiceManager.EarlyLoadedService]
internal unsafe class AddonLifecycle : IInternalDisposableService
{
private static readonly ModuleLog Log = new("AddonLifecycle");
private static readonly ModuleLog Log = ModuleLog.Create<AddonLifecycle>();
[ServiceManager.ServiceDependency]
private readonly Framework framework = Service<Framework>.Get();

View file

@ -14,7 +14,7 @@ namespace Dalamud.Game.Addon.Lifecycle;
/// </summary>
internal unsafe class AddonLifecycleReceiveEventListener : IDisposable
{
private static readonly ModuleLog Log = new("AddonLifecycle");
private static readonly ModuleLog Log = ModuleLog.Create<AddonLifecycle>();
[ServiceManager.ServiceDependency]
private readonly AddonLifecyclePooledArgs argsPool = Service<AddonLifecyclePooledArgs>.Get();

View file

@ -23,7 +23,7 @@ namespace Dalamud.Game;
[ServiceManager.EarlyLoadedService]
internal partial class ChatHandlers : IServiceType
{
private static readonly ModuleLog Log = new("ChatHandlers");
private static readonly ModuleLog Log = ModuleLog.Create<ChatHandlers>();
[ServiceManager.ServiceDependency]
private readonly DalamudConfiguration configuration = Service<DalamudConfiguration>.Get();

View file

@ -33,7 +33,7 @@ namespace Dalamud.Game.ClientState;
[ServiceManager.EarlyLoadedService]
internal sealed class ClientState : IInternalDisposableService, IClientState
{
private static readonly ModuleLog Log = new("ClientState");
private static readonly ModuleLog Log = ModuleLog.Create<ClientState>();
private readonly GameLifecycle lifecycle;
private readonly ClientStateAddressResolver address;

View file

@ -24,7 +24,7 @@ namespace Dalamud.Game.Command;
[ServiceManager.EarlyLoadedService]
internal sealed unsafe class CommandManager : IInternalDisposableService, ICommandManager
{
private static readonly ModuleLog Log = new("Command");
private static readonly ModuleLog Log = ModuleLog.Create<CommandManager>();
private readonly ConcurrentDictionary<string, IReadOnlyCommandInfo> commandMap = new();
private readonly ConcurrentDictionary<(string, IReadOnlyCommandInfo), string> commandAssemblyNameMap = new();
@ -262,7 +262,7 @@ internal sealed unsafe class CommandManager : IInternalDisposableService, IComma
#pragma warning restore SA1015
internal class CommandManagerPluginScoped : IInternalDisposableService, ICommandManager
{
private static readonly ModuleLog Log = new("Command");
private static readonly ModuleLog Log = ModuleLog.Create<CommandManager>();
[ServiceManager.ServiceDependency]
private readonly CommandManager commandManagerService = Service<CommandManager>.Get();

View file

@ -26,7 +26,7 @@ namespace Dalamud.Game;
[ServiceManager.EarlyLoadedService]
internal sealed class Framework : IInternalDisposableService, IFramework
{
private static readonly ModuleLog Log = new("Framework");
private static readonly ModuleLog Log = ModuleLog.Create<Framework>();
private static readonly Stopwatch StatsStopwatch = new();

View file

@ -38,7 +38,7 @@ namespace Dalamud.Game.Gui;
[ServiceManager.EarlyLoadedService]
internal sealed unsafe class ChatGui : IInternalDisposableService, IChatGui
{
private static readonly ModuleLog Log = new("ChatGui");
private static readonly ModuleLog Log = ModuleLog.Create<ChatGui>();
private readonly Queue<XivChatEntry> chatQueue = new();
private readonly Dictionary<(string PluginName, uint CommandId), Action<uint, SeString>> dalamudLinkHandlers = [];

View file

@ -29,7 +29,7 @@ namespace Dalamud.Game.Gui.ContextMenu;
[ServiceManager.EarlyLoadedService]
internal sealed unsafe class ContextMenu : IInternalDisposableService, IContextMenu
{
private static readonly ModuleLog Log = new("ContextMenu");
private static readonly ModuleLog Log = ModuleLog.Create<ContextMenu>();
private readonly Hook<AtkModuleVf22OpenAddonByAgentDelegate> atkModuleVf22OpenAddonByAgentHook;
private readonly Hook<AddonContextMenuOnMenuSelectedDelegate> addonContextMenuOnMenuSelectedHook;

View file

@ -30,7 +30,7 @@ internal sealed unsafe class DtrBar : IInternalDisposableService, IDtrBar
{
private const uint BaseNodeId = 1000;
private static readonly ModuleLog Log = new("DtrBar");
private static readonly ModuleLog Log = ModuleLog.Create<DtrBar>();
[ServiceManager.ServiceDependency]
private readonly Framework framework = Service<Framework>.Get();

View file

@ -32,7 +32,7 @@ namespace Dalamud.Game.Gui;
[ServiceManager.EarlyLoadedService]
internal sealed unsafe class GameGui : IInternalDisposableService, IGameGui
{
private static readonly ModuleLog Log = new("GameGui");
private static readonly ModuleLog Log = ModuleLog.Create<GameGui>();
private readonly GameGuiAddressResolver address;

View file

@ -22,7 +22,7 @@ namespace Dalamud.Game.Internal;
[ServiceManager.EarlyLoadedService]
internal sealed unsafe class DalamudAtkTweaks : IInternalDisposableService
{
private static readonly ModuleLog Log = new("DalamudAtkTweaks");
private static readonly ModuleLog Log = ModuleLog.Create<DalamudAtkTweaks>();
private readonly Hook<AgentHUD.Delegates.OpenSystemMenu> hookAgentHudOpenSystemMenu;

View file

@ -347,7 +347,7 @@ internal class GameInventory : IInternalDisposableService
#pragma warning restore SA1015
internal class GameInventoryPluginScoped : IInternalDisposableService, IGameInventory
{
private static readonly ModuleLog Log = new(nameof(GameInventoryPluginScoped));
private static readonly ModuleLog Log = ModuleLog.Create<GameInventoryPluginScoped>();
[ServiceManager.ServiceDependency]
private readonly GameInventory gameInventoryService = Service<GameInventory>.Get();

View file

@ -1,4 +1,4 @@
using System.Linq;
using System.Linq;
using Dalamud.Game.Network.Internal;
using Dalamud.Game.Network.Structures;
@ -95,7 +95,7 @@ internal class MarketBoard : IInternalDisposableService, IMarketBoard
#pragma warning restore SA1015
internal class MarketBoardPluginScoped : IInternalDisposableService, IMarketBoard
{
private static readonly ModuleLog Log = new(nameof(MarketBoardPluginScoped));
private static readonly ModuleLog Log = ModuleLog.Create<MarketBoardPluginScoped>();
[ServiceManager.ServiceDependency]
private readonly MarketBoard marketBoardService = Service<MarketBoard>.Get();

View file

@ -48,7 +48,7 @@ namespace Dalamud.Game.Text.Evaluator;
[ResolveVia<ISeStringEvaluator>]
internal class SeStringEvaluator : IServiceType, ISeStringEvaluator
{
private static readonly ModuleLog Log = new("SeStringEvaluator");
private static readonly ModuleLog Log = ModuleLog.Create<SeStringEvaluator>();
[ServiceManager.ServiceDependency]
private readonly ClientState.ClientState clientState = Service<ClientState.ClientState>.Get();

View file

@ -86,7 +86,7 @@ internal class NounProcessor : IServiceType
private const int PronounColumnIdx = 6;
private const int ArticleColumnIdx = 7;
private static readonly ModuleLog Log = new("NounProcessor");
private static readonly ModuleLog Log = ModuleLog.Create<NounProcessor>();
[ServiceManager.ServiceDependency]
private readonly DataManager dataManager = Service<DataManager>.Get();

View file

@ -21,7 +21,7 @@ internal class HookManager : IInternalDisposableService
/// <summary>
/// Logger shared with <see cref="Unhooker"/>.
/// </summary>
internal static readonly ModuleLog Log = new("HM");
internal static readonly ModuleLog Log = ModuleLog.Create<HookManager>();
[ServiceManager.ServiceConstructor]
private HookManager()

View file

@ -17,7 +17,7 @@ namespace Dalamud.Hooking.WndProcHook;
[ServiceManager.EarlyLoadedService]
internal sealed class WndProcHookManager : IInternalDisposableService
{
private static readonly ModuleLog Log = new(nameof(WndProcHookManager));
private static readonly ModuleLog Log = ModuleLog.Create<WndProcHookManager>();
private readonly Hook<DispatchMessageWDelegate> dispatchMessageWHook;
private readonly Dictionary<HWND, WndProcEventArgs> wndProcOverrides = [];

View file

@ -51,7 +51,7 @@ internal class DalamudInterface : IInternalDisposableService
{
private const float CreditsDarkeningMaxAlpha = 0.8f;
private static readonly ModuleLog Log = new("DUI");
private static readonly ModuleLog Log = ModuleLog.Create<DalamudInterface>();
private readonly Dalamud dalamud;
private readonly DalamudConfiguration configuration;

View file

@ -34,7 +34,7 @@ namespace Dalamud.Interface.Internal;
[ServiceManager.EarlyLoadedService]
internal sealed unsafe class ImGuiClipboardFunctionProvider : IInternalDisposableService
{
private static readonly ModuleLog Log = new(nameof(ImGuiClipboardFunctionProvider));
private static readonly ModuleLog Log = ModuleLog.Create<ImGuiClipboardFunctionProvider>();
private readonly void* clipboardUserDataOriginal;
private readonly void* setTextOriginal;
private readonly void* getTextOriginal;

View file

@ -76,7 +76,7 @@ internal partial class InterfaceManager : IInternalDisposableService
/// </summary>
public const float DefaultFontSizePx = (DefaultFontSizePt * 4.0f) / 3.0f;
private static readonly ModuleLog Log = new("INTERFACE");
private static readonly ModuleLog Log = ModuleLog.Create<InterfaceManager>();
private readonly ConcurrentBag<IDeferredDisposable> deferredDisposeTextures = [];
private readonly ConcurrentBag<IDisposable> deferredDisposeDisposables = [];

View file

@ -21,6 +21,9 @@ namespace Dalamud.Interface.Internal.UiDebug2;
/// </summary>
internal partial class UiDebug2 : IDisposable
{
/// <inheritdoc cref="ModuleLog"/>
internal static readonly ModuleLog Log = ModuleLog.Create<UiDebug2>();
private readonly ElementSelector elementSelector;
/// <summary>
@ -31,9 +34,6 @@ internal partial class UiDebug2 : IDisposable
this.elementSelector = new(this);
}
/// <inheritdoc cref="ModuleLog"/>
internal static ModuleLog Log { get; set; } = new("UiDebug2");
/// <inheritdoc cref="IGameGui"/>
internal static IGameGui GameGui { get; set; } = Service<GameGui>.Get();

View file

@ -17,7 +17,7 @@ namespace Dalamud.Interface.Internal.Windows.Data;
/// </summary>
internal class GameInventoryTestWidget : IDataWindowWidget
{
private static readonly ModuleLog Log = new(nameof(GameInventoryTestWidget));
private static readonly ModuleLog Log = ModuleLog.Create<GameInventoryTestWidget>();
private GameInventoryPluginScoped? scoped;
private bool standardEnabled;

View file

@ -41,7 +41,7 @@ namespace Dalamud.Interface.Internal.Windows.PluginInstaller;
/// </summary>
internal class PluginInstallerWindow : Window, IDisposable
{
private static readonly ModuleLog Log = new("PLUGINW");
private static readonly ModuleLog Log = ModuleLog.Create<PluginInstallerWindow>();
private readonly Vector4 changelogBgColor = new(0.114f, 0.584f, 0.192f, 0.678f);
private readonly Vector4 changelogTextColor = new(0.812f, 1.000f, 0.816f, 1.000f);

View file

@ -21,7 +21,7 @@ namespace Dalamud.Interface.Internal.Windows.SelfTest;
/// </summary>
internal class SelfTestWindow : Window
{
private static readonly ModuleLog Log = new("AGING");
private static readonly ModuleLog Log = ModuleLog.Create<SelfTestWindow>();
private readonly SelfTestRegistry selfTestRegistry;

View file

@ -43,7 +43,7 @@ internal sealed partial class FontAtlasFactory
/// </summary>
private static readonly Lock? NoConcurrentBuildOperationLock = null; // new();
private static readonly ModuleLog Log = new(nameof(FontAtlasFactory));
private static readonly ModuleLog Log = ModuleLog.Create<FontAtlasFactory>();
private static readonly Task<FontAtlasBuiltData> EmptyTask = Task.FromResult(default(FontAtlasBuiltData));

View file

@ -33,7 +33,7 @@ internal sealed partial class TextureManager
ITextureSubstitutionProvider,
ITextureReadbackProvider
{
private static readonly ModuleLog Log = new(nameof(TextureManager));
private static readonly ModuleLog Log = ModuleLog.Create<TextureManager>();
[ServiceManager.ServiceDependency]
private readonly Dalamud dalamud = Service<Dalamud>.Get();

View file

@ -32,7 +32,7 @@ public abstract class Window
{
private const float FadeInOutTime = 0.072f;
private static readonly ModuleLog Log = new("WindowSystem");
private static readonly ModuleLog Log = ModuleLog.Create<WindowSystem>();
private static bool wasEscPressedLastFrame = false;

View file

@ -20,7 +20,7 @@ namespace Dalamud.IoC.Internal;
[ServiceManager.ProvidedService]
internal class ServiceContainer : IServiceType
{
private static readonly ModuleLog Log = new("SERVICECONTAINER");
private static readonly ModuleLog Log = ModuleLog.Create<ServiceContainer>();
private readonly Dictionary<Type, ObjectInstance> instances = [];
private readonly Dictionary<Type, Type> interfaceToTypeMap = [];

View file

@ -15,7 +15,7 @@ namespace Dalamud.Logging.Internal;
[ServiceManager.EarlyLoadedService]
internal class TaskTracker : IInternalDisposableService
{
private static readonly ModuleLog Log = new("TT");
private static readonly ModuleLog Log = ModuleLog.Create<TaskTracker>();
private static readonly List<TaskInfo> TrackedTasksInternal = [];
private static readonly ConcurrentQueue<TaskInfo> NewlyCreatedTasks = new();
private static bool clearRequested = false;

View file

@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
@ -20,7 +20,7 @@ namespace Dalamud.Networking.Http;
/// </summary>
public class HappyEyeballsCallback : IDisposable
{
private static readonly ModuleLog Log = new("HTTP");
private static readonly ModuleLog Log = ModuleLog.Create<HappyEyeballsCallback>();
/*
* ToDo: Eventually add in some kind of state management to cache DNS and IP Family.

View file

@ -32,7 +32,7 @@ namespace Dalamud.Plugin.Internal.AutoUpdate;
[ServiceManager.EarlyLoadedService]
internal class AutoUpdateManager : IServiceType
{
private static readonly ModuleLog Log = new("AUTOUPDATE");
private static readonly ModuleLog Log = ModuleLog.Create<AutoUpdateManager>();
/// <summary>
/// Time we should wait after login to update.

View file

@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;
@ -14,7 +14,7 @@ namespace Dalamud.Plugin.Internal.Profiles;
/// </summary>
internal class Profile
{
private static readonly ModuleLog Log = new("PROFILE");
private static readonly ModuleLog Log = ModuleLog.Create<Profile>();
private readonly ProfileManager manager;
private readonly ProfileModelV1 modelV1;

View file

@ -17,7 +17,7 @@ namespace Dalamud.Plugin.Internal.Profiles;
[ServiceManager.BlockingEarlyLoadedService($"Data provider for {nameof(PluginManager)}.")]
internal partial class ProfileManager : IServiceType
{
private static readonly ModuleLog Log = new("PROFMAN");
private static readonly ModuleLog Log = ModuleLog.Create<ProfileManager>();
private readonly DalamudConfiguration config;
private readonly List<Profile> profiles = [];

View file

@ -17,7 +17,7 @@ namespace Dalamud.Plugin.Internal.Types;
/// </summary>
internal sealed class LocalDevPlugin : LocalPlugin
{
private static readonly ModuleLog Log = new("PLUGIN");
private static readonly ModuleLog Log = ModuleLog.Create<LocalDevPlugin>();
// Ref to Dalamud.Configuration.DevPluginSettings
private readonly DevPluginSettings devSettings;

View file

@ -33,7 +33,7 @@ internal class LocalPlugin : IAsyncDisposable
protected LocalPluginManifest manifest;
#pragma warning restore SA1401
private static readonly ModuleLog Log = new("LOCALPLUGIN");
private static readonly ModuleLog Log = ModuleLog.Create<LocalPlugin>();
private readonly FileInfo manifestFile;
private readonly FileInfo disabledFile;

View file

@ -29,7 +29,7 @@ internal class PluginRepository
private const int HttpRequestTimeoutSeconds = 20;
private static readonly ModuleLog Log = new("PLUGINR");
private static readonly ModuleLog Log = ModuleLog.Create<PluginRepository>();
private readonly HttpClient httpClient;
/// <summary>

View file

@ -35,7 +35,7 @@ internal static class ServiceManager
/// <summary>
/// Static log facility for Service{T}, to avoid duplicate instances for different types.
/// </summary>
public static readonly ModuleLog Log = new("SVC");
public static readonly ModuleLog Log = new(nameof(ServiceManager));
#if DEBUG
/// <summary>

View file

@ -27,7 +27,7 @@ namespace Dalamud.Storage;
[ServiceManager.ProvidedService]
internal class ReliableFileStorage : IInternalDisposableService
{
private static readonly ModuleLog Log = new("VFS");
private static readonly ModuleLog Log = ModuleLog.Create<ReliableFileStorage>();
private readonly Lock syncRoot = new();