-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLog.Seeding.cs
More file actions
141 lines (116 loc) · 5.33 KB
/
Copy pathLog.Seeding.cs
File metadata and controls
141 lines (116 loc) · 5.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
using Microsoft.Extensions.Logging;
namespace BookStore.ApiService.Infrastructure.Logging;
/// <summary>
/// Database seeding-related log messages.
/// </summary>
public static partial class Log
{
public static partial class Seeding
{
[LoggerMessage(
Level = LogLevel.Information,
Message = "Database already seeded, skipping")]
public static partial void DatabaseAlreadySeeded(ILogger logger);
[LoggerMessage(
Level = LogLevel.Information,
Message = "Seeding new tenant: {TenantId}")]
public static partial void SeedingNewTenant(ILogger logger, string tenantId);
[LoggerMessage(
Level = LogLevel.Information,
Message = "Updated existing tenant: {TenantId}")]
public static partial void UpdatedExistingTenant(ILogger logger, string tenantId);
[LoggerMessage(
Level = LogLevel.Information,
Message = "Starting database seeding for tenant '{TenantId}'...")]
public static partial void StartingTenantSeeding(ILogger logger, string tenantId);
[LoggerMessage(
Level = LogLevel.Information,
Message = "Sales already seeded, skipping sales seeding")]
public static partial void SalesAlreadySeeded(ILogger logger);
[LoggerMessage(
Level = LogLevel.Information,
Message = "Starting database seeding")]
public static partial void StartingDatabaseSeeding(ILogger logger);
[LoggerMessage(
Level = LogLevel.Information,
Message = "Database seeding completed successfully")]
public static partial void DatabaseSeedingCompleted(ILogger logger);
// Sales Seeding
[LoggerMessage(
Level = LogLevel.Information,
Message = "Starting sales seeding")]
public static partial void StartingSalesSeeding(ILogger logger);
[LoggerMessage(
Level = LogLevel.Information,
Message = "Found {BookCount} books for sales seeding")]
public static partial void FoundBooksForSalesSeeding(ILogger logger, int bookCount);
[LoggerMessage(
Level = LogLevel.Warning,
Message = "No books found for sales seeding")]
public static partial void NoBooksFoundForSalesSeeding(ILogger logger);
[LoggerMessage(
Level = LogLevel.Information,
Message = "Scheduled {Percentage}% sale for book {BookId} ({BookTitle})")]
public static partial void ScheduledSale(
ILogger logger,
decimal percentage,
Guid bookId,
string bookTitle);
[LoggerMessage(
Level = LogLevel.Information,
Message = "Sales seeding completed successfully")]
public static partial void SalesSeedingCompleted(ILogger logger);
[LoggerMessage(
Level = LogLevel.Error,
Message = "Error seeding sales")]
public static partial void ErrorSeedingSales(ILogger logger, Exception exception);
// Publishers Seeding
[LoggerMessage(
Level = LogLevel.Information,
Message = "Seeding publishers...")]
public static partial void SeedingPublishers(ILogger logger);
[LoggerMessage(
Level = LogLevel.Information,
Message = "Seeded {Count} publishers")]
public static partial void seededPublishers(ILogger logger, int count);
// Authors Seeding
[LoggerMessage(
Level = LogLevel.Information,
Message = "Seeding authors...")]
public static partial void SeedingAuthors(ILogger logger);
[LoggerMessage(
Level = LogLevel.Information,
Message = "Seeded {Count} authors")]
public static partial void SeededAuthors(ILogger logger, int count);
// Categories Seeding
[LoggerMessage(
Level = LogLevel.Information,
Message = "Seeding categories...")]
public static partial void SeedingCategories(ILogger logger);
[LoggerMessage(
Level = LogLevel.Information,
Message = "Seeded {Count} categories")]
public static partial void SeededCategories(ILogger logger, int count);
// Books Seeding
[LoggerMessage(
Level = LogLevel.Information,
Message = "Seeding books...")]
public static partial void SeedingBooks(ILogger logger);
[LoggerMessage(
Level = LogLevel.Information,
Message = "Seeded {Count} books")]
public static partial void SeededBooks(ILogger logger, int count);
[LoggerMessage(
Level = LogLevel.Error,
Message = "Failed to generate cover for {BookTitle}")]
public static partial void FailedToGenerateCover(ILogger logger, Exception exception, string bookTitle);
[LoggerMessage(
Level = LogLevel.Information,
Message = "Updated existing admin user {Email} in tenant {TenantId}")]
public static partial void UpdatedExistingAdminUser(ILogger logger, string email, string tenantId);
[LoggerMessage(
Level = LogLevel.Information,
Message = "Created new admin user {Email} in tenant {TenantId}")]
public static partial void CreatedNewAdminUser(ILogger logger, string email, string tenantId);
}
}