Browse Source
Extract DomainObject log message to centralized LogMessages
pull/1318/head
copilot-swe-agent[bot]
4 months ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with
4 additions and
1 deletions
-
backend/src/Squidex.Infrastructure/Commands/DomainObject.cs
-
backend/src/Squidex.Infrastructure/LogMessages.cs
|
|
@ -152,7 +152,7 @@ public abstract partial class DomainObject<T> : IAggregate where T : Entity, new |
|
|
} |
|
|
} |
|
|
catch (Exception ex) |
|
|
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); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -55,4 +55,7 @@ internal static partial class LogMessages |
|
|
|
|
|
|
|
|
[LoggerMessage(Level = LogLevel.Error, Message = "Failed to track usage in background.")] |
|
|
[LoggerMessage(Level = LogLevel.Error, Message = "Failed to track usage in background.")] |
|
|
public static partial void LogTrackUsageFailed(ILogger logger, Exception exception); |
|
|
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); |
|
|
} |
|
|
} |
|
|
|