mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2025-08-21 15:52:56 +00:00
Added the logger factory for static classes
This commit is contained in:
parent
abeee2408f
commit
a845cff7e2
@ -22,6 +22,7 @@ internal sealed class Program
|
||||
public static Encryption ENCRYPTION = null!;
|
||||
public static string API_TOKEN = null!;
|
||||
public static IServiceProvider SERVICE_PROVIDER = null!;
|
||||
public static ILoggerFactory LOGGER_FACTORY = null!;
|
||||
|
||||
public static async Task Main(string[] args)
|
||||
{
|
||||
@ -147,6 +148,9 @@ internal sealed class Program
|
||||
// Execute the builder to get the app:
|
||||
var app = builder.Build();
|
||||
|
||||
// Get the logging factory for e.g., static classes:
|
||||
LOGGER_FACTORY = app.Services.GetRequiredService<ILoggerFactory>();
|
||||
|
||||
// Get a program logger:
|
||||
var programLogger = app.Services.GetRequiredService<ILogger<Program>>();
|
||||
programLogger.LogInformation("Starting the AI Studio server.");
|
||||
|
Loading…
Reference in New Issue
Block a user