Refactor logging messages for consistency and clarity
CI / Backend (build + test) (push) Successful in 1m14s
CI / Frontend (lint + typecheck + build) (push) Successful in 43s

- Updated various logging messages across the application to replace Russian text with English equivalents, ensuring consistency in error and information logs.
- Enhanced clarity in log messages related to Telegram bot operations, user management commands, and health check services, improving overall traceability and understanding of application behavior.
This commit is contained in:
Leonid Pershin
2026-07-02 15:04:10 +03:00
parent 3cdd3adf5e
commit 48f620b964
10 changed files with 22 additions and 22 deletions
@@ -23,7 +23,7 @@ public sealed class NodeHealthCheckService(IServiceScopeFactory scopeFactory, IL
}
catch (Exception ex)
{
logger.LogError(ex, "Ошибка health-check нод");
logger.LogError(ex, "Node health-check failed");
}
}
while (await timer.WaitForNextTickAsync(stoppingToken));
@@ -25,7 +25,7 @@ public sealed class TrafficRetentionService(
}
catch (Exception ex)
{
logger.LogError(ex, "Ошибка ретеншна истории трафика");
logger.LogError(ex, "Traffic history retention failed");
}
}
while (await timer.WaitForNextTickAsync(stoppingToken));
@@ -40,6 +40,6 @@ public sealed class TrafficRetentionService(
var deleted = await dbContext.TrafficSamples.Where(s => s.Timestamp < cutoff).ExecuteDeleteAsync(cancellationToken);
if (deleted > 0)
logger.LogInformation("Удалено {Count} устаревших записей истории трафика", deleted);
logger.LogInformation("Deleted {Count} expired traffic history records", deleted);
}
}
@@ -28,7 +28,7 @@ public sealed class TrafficSyncService(IServiceScopeFactory scopeFactory, ILogge
}
catch (Exception ex)
{
logger.LogError(ex, "Ошибка синхронизации трафика");
logger.LogError(ex, "Traffic sync failed");
}
}
while (await timer.WaitForNextTickAsync(stoppingToken));
@@ -38,10 +38,10 @@ public sealed class DbInitializer(
if (!result.Succeeded)
{
throw new InvalidOperationException(
$"Не удалось создать роль '{name}': {string.Join(", ", result.Errors.Select(e => e.Description))}");
$"Failed to create role '{name}': {string.Join(", ", result.Errors.Select(e => e.Description))}");
}
logger.LogInformation("Создана системная роль {RoleName}", name);
logger.LogInformation("Created system role {RoleName}", name);
}
private async Task SeedAdminAsync()
@@ -49,7 +49,7 @@ public sealed class DbInitializer(
var options = adminSeedOptions.Value;
if (string.IsNullOrWhiteSpace(options.Username) || string.IsNullOrWhiteSpace(options.Password))
{
logger.LogWarning("AdminSeed__Username/AdminSeed__Password не заданы — учётка администратора не создана");
logger.LogWarning("AdminSeed__Username/AdminSeed__Password not set — admin account not created");
return;
}
@@ -68,11 +68,11 @@ public sealed class DbInitializer(
if (!createResult.Succeeded)
{
throw new InvalidOperationException(
$"Не удалось создать администратора: {string.Join(", ", createResult.Errors.Select(e => e.Description))}");
$"Failed to create admin account: {string.Join(", ", createResult.Errors.Select(e => e.Description))}");
}
await userManager.AddToRoleAsync(admin, RoleNames.Admin);
logger.LogInformation("Создана учётка администратора {Username}", options.Username);
logger.LogInformation("Created admin account {Username}", options.Username);
}
private async Task SeedClientAppsAsync(CancellationToken cancellationToken)
@@ -83,7 +83,7 @@ public sealed class DbInitializer(
var path = Path.Combine(AppContext.BaseDirectory, "seed", "client-apps.json");
if (!File.Exists(path))
{
logger.LogWarning("Файл сида каталога приложений не найден: {Path}", path);
logger.LogWarning("Client app catalog seed file not found: {Path}", path);
return;
}
@@ -94,7 +94,7 @@ public sealed class DbInitializer(
{
if (!Enum.TryParse<OsPlatform>(entry.OperatingSystem, ignoreCase: true, out var os))
{
logger.LogWarning("Неизвестная ОС '{Os}' в сиде каталога приложений — пропущено", entry.OperatingSystem);
logger.LogWarning("Unknown OS '{Os}' in client app catalog seed — skipped", entry.OperatingSystem);
continue;
}
@@ -104,7 +104,7 @@ public sealed class DbInitializer(
}
await dbContext.SaveChangesAsync(cancellationToken);
logger.LogInformation("Засеян каталог приложений: {Count} записей", entries.Count);
logger.LogInformation("Seeded client app catalog: {Count} entries", entries.Count);
}
private sealed record ClientAppSeedEntry(