34 lines
993 B
C#
34 lines
993 B
C#
using Grpc.Core.Interceptors;
|
|
using Grpc.Net.Client;
|
|
using EonaCat.gRPC.Client.Helpers;
|
|
using EonaCat.gRPC.Client;
|
|
using EonaCat.LogStack.Logging;
|
|
using EonaCat.LogStack.Extensions;
|
|
using Microsoft.Extensions.Logging;
|
|
|
|
Console.WriteLine("Welcome to EonaCat.gRPC Client Application.");
|
|
|
|
const string serverAddress = "http://localhost:5227";
|
|
|
|
//var (invoker, channel) = Extension.ConfigureChannel(serverAddress, loggerFactory);
|
|
|
|
using var channel = GrpcChannel.ForAddress(serverAddress, new GrpcChannelOptions
|
|
{
|
|
LoggerFactory = Microsoft.Extensions.Logging.LoggerFactory.Create(builder =>
|
|
{
|
|
builder.AddEonaCatLogging();
|
|
builder.SetMinimumLevel(LogLevel.Debug);
|
|
})
|
|
});
|
|
|
|
var invoker = channel.Intercept(new TracerInterceptor(Microsoft.Extensions.Logging.LoggerFactory.Create(builder =>
|
|
{
|
|
builder.AddEonaCatLogging();
|
|
builder.SetMinimumLevel(LogLevel.Debug);
|
|
})));
|
|
|
|
await Extension.ExecutePrograms(invoker);
|
|
|
|
Console.ReadKey();
|
|
await channel.ShutdownAsync();
|