Files: added logging

This commit is contained in:
Maksim Chegulov 2022-12-16 11:45:39 +03:00
parent 30692753bf
commit 496d7d2d48
2 changed files with 8 additions and 1 deletions

View File

@ -207,11 +207,15 @@ public class RoomLogoManager
{
var index = fileName.LastIndexOf('.');
var fileNameWithoutExt = (index != -1) ? fileName.Substring(0, index) : fileName;
try
{
await DataStore.DeleteFilesAsync(TempDomainPath, "", fileNameWithoutExt + "*.*", false);
}
catch { }
catch(Exception e)
{
_logger.ErrorRemoveTempPhoto(e);
}
}
private async Task<string> SaveWithProcessAsync<T>(T id, byte[] imageData, long maxFileSize, Point position, Size cropSize)

View File

@ -30,4 +30,7 @@ public static partial class RoomLogoManagerLogger
{
[LoggerMessage(Level = LogLevel.Error, Message = "RemoveRoomLogo")]
public static partial void ErrorRemoveRoomLogo(this ILogger<RoomLogoManager> logger, Exception exception);
[LoggerMessage(Level = LogLevel.Error, Message = "RemoveTempPhoto")]
public static partial void ErrorRemoveTempPhoto(this ILogger<RoomLogoManager> logger, Exception exception);
}