From 4d210946db45629e75c0f60b370a669f4265b25b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 26 May 2026 17:13:02 +0000 Subject: [PATCH] Extract DomainObject log message to centralized LogMessages --- backend/src/Squidex.Infrastructure/Commands/DomainObject.cs | 2 +- backend/src/Squidex.Infrastructure/LogMessages.cs | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/backend/src/Squidex.Infrastructure/Commands/DomainObject.cs b/backend/src/Squidex.Infrastructure/Commands/DomainObject.cs index 07a1d31f2..afb218031 100644 --- a/backend/src/Squidex.Infrastructure/Commands/DomainObject.cs +++ b/backend/src/Squidex.Infrastructure/Commands/DomainObject.cs @@ -152,7 +152,7 @@ public abstract partial class DomainObject : IAggregate where T : Entity, new } catch (Exception ex) { - log.LogError(ex, "Failed to repair snapshot for domain object of type {type} with ID {id}.", GetType(), UniqueId); + LogMessages.LogFailedToRepairDomainObjectSnapshot(log, GetType(), UniqueId, ex); } } diff --git a/backend/src/Squidex.Infrastructure/LogMessages.cs b/backend/src/Squidex.Infrastructure/LogMessages.cs index ff0a46e36..0577f22f3 100644 --- a/backend/src/Squidex.Infrastructure/LogMessages.cs +++ b/backend/src/Squidex.Infrastructure/LogMessages.cs @@ -55,4 +55,7 @@ internal static partial class LogMessages [LoggerMessage(Level = LogLevel.Error, Message = "Failed to track usage in background.")] public static partial void LogTrackUsageFailed(ILogger logger, Exception exception); + + [LoggerMessage(Level = LogLevel.Error, Message = "Failed to repair snapshot for domain object of type {type} with ID {id}.")] + public static partial void LogFailedToRepairDomainObjectSnapshot(ILogger logger, Type type, DomainId id, Exception exception); }