Browse Source

Extract DomainObject log message to centralized LogMessages

pull/1318/head
copilot-swe-agent[bot] 4 months ago
committed by GitHub
parent
commit
4d210946db
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 2
      backend/src/Squidex.Infrastructure/Commands/DomainObject.cs
  2. 3
      backend/src/Squidex.Infrastructure/LogMessages.cs

2
backend/src/Squidex.Infrastructure/Commands/DomainObject.cs

@ -152,7 +152,7 @@ public abstract partial class DomainObject<T> : 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);
}
}

3
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);
}

Loading…
Cancel
Save