less logs

This commit is contained in:
Anton Martynenko
2025-11-19 18:18:19 +01:00
parent eff7ca4dba
commit 48ebad0609
7 changed files with 3 additions and 314 deletions
-24
View File
@@ -34,20 +34,7 @@ public class TileService : ITileService
var existingTiles = await _tileRepository.GetTilesByRegionAsync(latitude, longitude, sizeMeters, zoomLevel);
var existingTilesList = existingTiles.Where(t => t.Version == currentVersion).ToList();
_logger.LogInformation("Found {Count} existing tiles for region (version {Version})", existingTilesList.Count, currentVersion);
if (existingTilesList.Any())
{
_logger.LogInformation("Existing tiles in DB:");
foreach (var et in existingTilesList)
{
_logger.LogInformation(" DB Tile: Lat={Lat:F12}, Lon={Lon:F12}, Zoom={Zoom}", et.Latitude, et.Longitude, et.ZoomLevel);
}
}
var centerPoint = new GeoPoint(latitude, longitude);
_logger.LogInformation("TileService - Downloading tiles for center: Lat={Lat:F12}, Lon={Lon:F12}, Radius={Radius}m, Zoom={Zoom}",
latitude, longitude, sizeMeters / 2, zoomLevel);
var downloadedTiles = await _downloader.GetTilesWithMetadataAsync(
centerPoint,
@@ -56,8 +43,6 @@ public class TileService : ITileService
existingTilesList,
cancellationToken);
_logger.LogInformation("Downloaded {Count} new tiles from Google", downloadedTiles.Count);
var result = new List<TileMetadata>();
int reusedCount = existingTilesList.Count;
int downloadedCount = downloadedTiles.Count;
@@ -71,9 +56,6 @@ public class TileService : ITileService
{
var now = DateTime.UtcNow;
_logger.LogInformation("TileService - Preparing to save tile: CenterLat={CenterLat:F12}, CenterLon={CenterLon:F12} from downloader",
downloadedTile.CenterLatitude, downloadedTile.CenterLongitude);
var tileEntity = new TileEntity
{
Id = Guid.NewGuid(),
@@ -90,15 +72,9 @@ public class TileService : ITileService
UpdatedAt = now
};
_logger.LogInformation("TileService - TileEntity before DB insert: Lat={Lat:F12}, Lon={Lon:F12}",
tileEntity.Latitude, tileEntity.Longitude);
await _tileRepository.InsertAsync(tileEntity);
_logger.LogInformation("Saved new tile {Id} at ({Lat:F12}, {Lon:F12}) version {Version}", tileEntity.Id, tileEntity.Latitude, tileEntity.Longitude, currentVersion);
result.Add(MapToMetadata(tileEntity));
}
_logger.LogInformation("Tile processing summary: {Reused} reused, {Downloaded} new", reusedCount, downloadedCount);
return result;
}