Skip to content

Commit dcd65b0

Browse files
committed
Don't disable colors. Report runtime version
1 parent f0e645c commit dcd65b0

File tree

4 files changed

+13
-6
lines changed

4 files changed

+13
-6
lines changed

src/Grpc/test/testassets/InteropClient/InteropClient.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,10 @@
2929
using Google.Protobuf;
3030
using Grpc.Auth;
3131
using Grpc.Core;
32-
using Grpc.Core.Utils;
3332
using Grpc.Net.Client;
3433
using Grpc.Testing;
3534
using Microsoft.Extensions.DependencyInjection;
3635
using Microsoft.Extensions.Logging;
37-
using Microsoft.Extensions.Logging.Console;
3836
using Newtonsoft.Json.Linq;
3937

4038
namespace InteropTestsClient
@@ -101,7 +99,6 @@ private InteropClient(ClientOptions options)
10199
configure.AddSimpleConsole(loggerOptions =>
102100
{
103101
loggerOptions.IncludeScopes = true;
104-
loggerOptions.ColorBehavior = LoggerColorBehavior.Disabled;
105102
});
106103
});
107104

src/Grpc/test/testassets/InteropClient/Program.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#endregion
1818

1919
using System;
20+
using System.Reflection;
2021

2122
namespace InteropTestsClient
2223
{
@@ -26,6 +27,9 @@ public static void Main(string[] args)
2627
{
2728
Console.WriteLine("Application started.");
2829

30+
var runtimeVersion = typeof(object).GetTypeInfo().Assembly.GetCustomAttribute<AssemblyInformationalVersionAttribute>()?.InformationalVersion ?? "Unknown";
31+
Console.WriteLine($"NetCoreAppVersion: {runtimeVersion}");
32+
2933
InteropClient.Run(args);
3034
}
3135
}

src/Grpc/test/testassets/InteropWebsite/Program.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
using Microsoft.Extensions.Configuration;
2424
using Microsoft.Extensions.Hosting;
2525
using Microsoft.Extensions.Logging;
26-
using Microsoft.Extensions.Logging.Console;
2726

2827
namespace InteropTestsWebsite
2928
{
@@ -38,7 +37,7 @@ public static IHostBuilder CreateHostBuilder(string[] args) =>
3837
Host.CreateDefaultBuilder(args)
3938
.ConfigureLogging(builder =>
4039
{
41-
builder.AddSimpleConsole(o => o.ColorBehavior = LoggerColorBehavior.Disabled);
40+
builder.AddSimpleConsole();
4241
builder.SetMinimumLevel(LogLevel.Trace);
4342
})
4443
.ConfigureWebHostDefaults(webBuilder =>

src/Grpc/test/testassets/InteropWebsite/Startup.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#endregion
1818

1919
using System;
20+
using System.Reflection;
2021
using Grpc.Testing;
2122
using Microsoft.AspNetCore.Builder;
2223
using Microsoft.Extensions.DependencyInjection;
@@ -37,7 +38,13 @@ public void ConfigureServices(IServiceCollection services)
3738
public void Configure(IApplicationBuilder app, IHostApplicationLifetime applicationLifetime)
3839
{
3940
// Required to notify test infrastructure that it can begin tests
40-
applicationLifetime.ApplicationStarted.Register(() => Console.WriteLine("Application started."));
41+
applicationLifetime.ApplicationStarted.Register(() =>
42+
{
43+
Console.WriteLine("Application started.");
44+
45+
var runtimeVersion = typeof(object).GetTypeInfo().Assembly.GetCustomAttribute<AssemblyInformationalVersionAttribute>()?.InformationalVersion ?? "Unknown";
46+
Console.WriteLine($"NetCoreAppVersion: {runtimeVersion}");
47+
});
4148

4249
app.UseRouting();
4350
app.UseEndpoints(endpoints =>

0 commit comments

Comments
 (0)