From b4adbaa34ea2c711319ccba4a936e86c95749349 Mon Sep 17 00:00:00 2001 From: Andrew Date: Sun, 5 Mar 2023 13:07:21 +0200 Subject: [PATCH 1/9] Update Microsoft.Extensions.Configuration.Binder version --- .../X.Extensions.Logging.Telegram.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/X.Extensions.Logging.Telegram/X.Extensions.Logging.Telegram.csproj b/src/X.Extensions.Logging.Telegram/X.Extensions.Logging.Telegram.csproj index 1be8c3a..7e51dcb 100644 --- a/src/X.Extensions.Logging.Telegram/X.Extensions.Logging.Telegram.csproj +++ b/src/X.Extensions.Logging.Telegram/X.Extensions.Logging.Telegram.csproj @@ -19,7 +19,7 @@ - + From ccab16d1c0d97b6eda589e1026efde0a51eab748 Mon Sep 17 00:00:00 2001 From: Andrew Date: Sun, 5 Mar 2023 13:08:21 +0200 Subject: [PATCH 2/9] Remove .NET 3.1 example --- X.Extensions.Logging.Telegram.sln | 9 +-- .../Controllers/WeatherForecastController.cs | 42 ----------- examples/WebApp.NextVersion/Program.cs | 31 -------- .../Properties/launchSettings.json | 31 -------- .../WebApp.NextVersion/WeatherForecast.cs | 12 ---- .../WebApp.NextVersion.csproj | 17 ----- .../appsettings.Development.json | 8 --- examples/WebApp.NextVersion/appsettings.json | 18 ----- .../Controllers/WeatherForecastController.cs | 70 ++++++++----------- examples/WebApp/Program.cs | 56 +++++++-------- .../WebApp/Properties/launchSettings.json | 18 ++--- examples/WebApp/Startup.cs | 52 -------------- examples/WebApp/WeatherForecast.cs | 15 ++-- examples/WebApp/WebApp.csproj | 6 +- examples/WebApp/appsettings.Development.json | 3 +- examples/WebApp/appsettings.json | 10 ++- 16 files changed, 83 insertions(+), 315 deletions(-) delete mode 100644 examples/WebApp.NextVersion/Controllers/WeatherForecastController.cs delete mode 100644 examples/WebApp.NextVersion/Program.cs delete mode 100644 examples/WebApp.NextVersion/Properties/launchSettings.json delete mode 100644 examples/WebApp.NextVersion/WeatherForecast.cs delete mode 100644 examples/WebApp.NextVersion/WebApp.NextVersion.csproj delete mode 100644 examples/WebApp.NextVersion/appsettings.Development.json delete mode 100644 examples/WebApp.NextVersion/appsettings.json delete mode 100644 examples/WebApp/Startup.cs diff --git a/X.Extensions.Logging.Telegram.sln b/X.Extensions.Logging.Telegram.sln index dc9412e..feefc7e 100644 --- a/X.Extensions.Logging.Telegram.sln +++ b/X.Extensions.Logging.Telegram.sln @@ -10,11 +10,9 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "X.Extensions.Logging.Telegr EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "examples", "examples", "{FE4C92EB-3AE0-4FC2-B2C5-5C94820B1763}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebApp", "examples\WebApp\WebApp.csproj", "{0D0DB3AB-7168-40AD-9844-E287D32C9F0A}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConsoleApp", "examples\ConsoleApp\ConsoleApp.csproj", "{0CB25DBB-1659-4BE3-AE19-189ED5808E74}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebApp.NextVersion", "examples\WebApp.NextVersion\WebApp.NextVersion.csproj", "{AED236EF-E9D0-4820-8CB7-D35F8EE6AB6F}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebApp", "examples\WebApp\WebApp.csproj", "{AED236EF-E9D0-4820-8CB7-D35F8EE6AB6F}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -30,10 +28,6 @@ Global {8E60254D-72D7-4E6E-8592-E12F01FFBF0C}.Debug|Any CPU.Build.0 = Debug|Any CPU {8E60254D-72D7-4E6E-8592-E12F01FFBF0C}.Release|Any CPU.ActiveCfg = Release|Any CPU {8E60254D-72D7-4E6E-8592-E12F01FFBF0C}.Release|Any CPU.Build.0 = Release|Any CPU - {0D0DB3AB-7168-40AD-9844-E287D32C9F0A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0D0DB3AB-7168-40AD-9844-E287D32C9F0A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0D0DB3AB-7168-40AD-9844-E287D32C9F0A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0D0DB3AB-7168-40AD-9844-E287D32C9F0A}.Release|Any CPU.Build.0 = Release|Any CPU {0CB25DBB-1659-4BE3-AE19-189ED5808E74}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {0CB25DBB-1659-4BE3-AE19-189ED5808E74}.Debug|Any CPU.Build.0 = Debug|Any CPU {0CB25DBB-1659-4BE3-AE19-189ED5808E74}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -46,7 +40,6 @@ Global GlobalSection(NestedProjects) = preSolution {0E1C0807-2482-4007-B0E0-F87A3A9A2898} = {D7219AE6-E36B-4CE1-9581-B341751BA4EB} {8E60254D-72D7-4E6E-8592-E12F01FFBF0C} = {4EE5DDEB-64BD-4BA7-95E6-1C3E82DF1671} - {0D0DB3AB-7168-40AD-9844-E287D32C9F0A} = {FE4C92EB-3AE0-4FC2-B2C5-5C94820B1763} {0CB25DBB-1659-4BE3-AE19-189ED5808E74} = {FE4C92EB-3AE0-4FC2-B2C5-5C94820B1763} {AED236EF-E9D0-4820-8CB7-D35F8EE6AB6F} = {FE4C92EB-3AE0-4FC2-B2C5-5C94820B1763} EndGlobalSection diff --git a/examples/WebApp.NextVersion/Controllers/WeatherForecastController.cs b/examples/WebApp.NextVersion/Controllers/WeatherForecastController.cs deleted file mode 100644 index c337741..0000000 --- a/examples/WebApp.NextVersion/Controllers/WeatherForecastController.cs +++ /dev/null @@ -1,42 +0,0 @@ -using Microsoft.AspNetCore.Mvc; - -namespace WebApp.NextVersion.Controllers; - -[ApiController] -[Route("[controller]")] -public class WeatherForecastController : ControllerBase -{ - private static readonly string[] Summaries = new[] - { - "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" - }; - - private readonly ILogger _logger; - - public WeatherForecastController(ILogger logger) - { - _logger = logger; - } - - [HttpGet(Name = "GetWeatherForecast")] - public IEnumerable Get() - { - var rng = new Random(); - var temperatureC = rng.Next(-20, 55); - - _logger.LogTrace($"Trace Temperature: {temperatureC}"); - _logger.LogDebug($"Debug Temperature: {temperatureC}"); - _logger.LogInformation($"Information Temperature: {temperatureC}"); - _logger.LogWarning($"Warning Temperature: {temperatureC}"); - _logger.LogError($"Error Temperature: {temperatureC}"); - _logger.LogCritical($"Critical Temperature: {temperatureC}"); - - return Enumerable.Range(1, 5).Select(index => new WeatherForecast - { - Date = DateTime.Now.AddDays(index), - TemperatureC = temperatureC, - Summary = Summaries[rng.Next(Summaries.Length)] - }) - .ToArray(); - } -} \ No newline at end of file diff --git a/examples/WebApp.NextVersion/Program.cs b/examples/WebApp.NextVersion/Program.cs deleted file mode 100644 index 8b61615..0000000 --- a/examples/WebApp.NextVersion/Program.cs +++ /dev/null @@ -1,31 +0,0 @@ -using X.Extensions.Logging.Telegram; - -var builder = WebApplication.CreateBuilder(args); - -// Add services to the container. - -builder.Services.AddControllers(); -// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle -builder.Services.AddEndpointsApiExplorer(); -builder.Services.AddSwaggerGen(); - -builder.Logging.ClearProviders(); -builder.Logging.AddConsole(); -builder.Logging.AddTelegram(builder.Configuration); - -var app = builder.Build(); - -// Configure the HTTP request pipeline. -if (app.Environment.IsDevelopment()) -{ - app.UseSwagger(); - app.UseSwaggerUI(); -} - -app.UseHttpsRedirection(); - -app.UseAuthorization(); - -app.MapControllers(); - -app.Run(); \ No newline at end of file diff --git a/examples/WebApp.NextVersion/Properties/launchSettings.json b/examples/WebApp.NextVersion/Properties/launchSettings.json deleted file mode 100644 index 942149f..0000000 --- a/examples/WebApp.NextVersion/Properties/launchSettings.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "$schema": "https://json.schemastore.org/launchsettings.json", - "iisSettings": { - "windowsAuthentication": false, - "anonymousAuthentication": true, - "iisExpress": { - "applicationUrl": "http://localhost:24153", - "sslPort": 44367 - } - }, - "profiles": { - "WebApp.NextVersion": { - "commandName": "Project", - "dotnetRunMessages": true, - "launchBrowser": true, - "launchUrl": "swagger", - "applicationUrl": "https://localhost:7065;http://localhost:5130", - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } - }, - "IIS Express": { - "commandName": "IISExpress", - "launchBrowser": true, - "launchUrl": "swagger", - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } - } - } -} diff --git a/examples/WebApp.NextVersion/WeatherForecast.cs b/examples/WebApp.NextVersion/WeatherForecast.cs deleted file mode 100644 index 2b9818c..0000000 --- a/examples/WebApp.NextVersion/WeatherForecast.cs +++ /dev/null @@ -1,12 +0,0 @@ -namespace WebApp.NextVersion; - -public class WeatherForecast -{ - public DateTime Date { get; set; } - - public int TemperatureC { get; set; } - - public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); - - public string? Summary { get; set; } -} \ No newline at end of file diff --git a/examples/WebApp.NextVersion/WebApp.NextVersion.csproj b/examples/WebApp.NextVersion/WebApp.NextVersion.csproj deleted file mode 100644 index 9f5a746..0000000 --- a/examples/WebApp.NextVersion/WebApp.NextVersion.csproj +++ /dev/null @@ -1,17 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - - - - - diff --git a/examples/WebApp.NextVersion/appsettings.Development.json b/examples/WebApp.NextVersion/appsettings.Development.json deleted file mode 100644 index 0c208ae..0000000 --- a/examples/WebApp.NextVersion/appsettings.Development.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "Logging": { - "LogLevel": { - "Default": "Information", - "Microsoft.AspNetCore": "Warning" - } - } -} diff --git a/examples/WebApp.NextVersion/appsettings.json b/examples/WebApp.NextVersion/appsettings.json deleted file mode 100644 index 1d32d4a..0000000 --- a/examples/WebApp.NextVersion/appsettings.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "Logging": { - "LogLevel": { - "Default": "Information", - "Microsoft.AspNetCore": "Warning" - }, - "Telegram": { - "LogLevel": { - "Default": "Error" - }, - "AccessToken": "1234567890:AAAaaAAaa_AaAAaa-AAaAAAaAAaAaAaAAAA", - "ChatId": "-0000000000000", - "UseEmoji": "true", - "Source": "WebApp.NextVersion" - } - }, - "AllowedHosts": "*" -} diff --git a/examples/WebApp/Controllers/WeatherForecastController.cs b/examples/WebApp/Controllers/WeatherForecastController.cs index c445745..8cf715f 100644 --- a/examples/WebApp/Controllers/WeatherForecastController.cs +++ b/examples/WebApp/Controllers/WeatherForecastController.cs @@ -1,50 +1,42 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; -using Microsoft.Extensions.Logging; -namespace WebApp.Controllers +namespace WebApp.Controllers; + +[ApiController] +[Route("[controller]")] +public class WeatherForecastController : ControllerBase { - [ApiController] - [Route("[controller]")] - public class WeatherForecastController : ControllerBase + private static readonly string[] Summaries = new[] { - private static readonly string[] Summaries = new[] - { - "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" - }; + "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" + }; - private readonly ILogger _logger; + private readonly ILogger _logger; - public WeatherForecastController(ILogger logger) - { - _logger = logger; - - _logger.LogWarning("WeatherForecastController created"); - } + public WeatherForecastController(ILogger logger) + { + _logger = logger; + } - [HttpGet] - public IEnumerable Get() - { - var rng = new Random(); - var temperatureC = rng.Next(-20, 55); + [HttpGet(Name = "GetWeatherForecast")] + public IEnumerable Get() + { + var rng = new Random(); + var temperatureC = rng.Next(-20, 55); - _logger.LogTrace($"Trace Temperature: {temperatureC}"); - _logger.LogDebug($"Debug Temperature: {temperatureC}"); - _logger.LogInformation($"Information Temperature: {temperatureC}"); - _logger.LogWarning($"Warning Temperature: {temperatureC}"); - _logger.LogError($"Error Temperature: {temperatureC}"); - _logger.LogCritical($"Critical Temperature: {temperatureC}"); + _logger.LogTrace($"Trace Temperature: {temperatureC}"); + _logger.LogDebug($"Debug Temperature: {temperatureC}"); + _logger.LogInformation($"Information Temperature: {temperatureC}"); + _logger.LogWarning($"Warning Temperature: {temperatureC}"); + _logger.LogError($"Error Temperature: {temperatureC}"); + _logger.LogCritical($"Critical Temperature: {temperatureC}"); - return Enumerable.Range(1, 5).Select(index => new WeatherForecast - { - Date = DateTime.Now.AddDays(index), - TemperatureC = temperatureC, - Summary = Summaries[rng.Next(Summaries.Length)] - }) - .ToArray(); - } + return Enumerable.Range(1, 5).Select(index => new WeatherForecast + { + Date = DateTime.Now.AddDays(index), + TemperatureC = temperatureC, + Summary = Summaries[rng.Next(Summaries.Length)] + }) + .ToArray(); } } \ No newline at end of file diff --git a/examples/WebApp/Program.cs b/examples/WebApp/Program.cs index 5c0ee27..8b61615 100644 --- a/examples/WebApp/Program.cs +++ b/examples/WebApp/Program.cs @@ -1,31 +1,31 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Hosting; -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.Hosting; -using Microsoft.Extensions.Logging; using X.Extensions.Logging.Telegram; -namespace WebApp +var builder = WebApplication.CreateBuilder(args); + +// Add services to the container. + +builder.Services.AddControllers(); +// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle +builder.Services.AddEndpointsApiExplorer(); +builder.Services.AddSwaggerGen(); + +builder.Logging.ClearProviders(); +builder.Logging.AddConsole(); +builder.Logging.AddTelegram(builder.Configuration); + +var app = builder.Build(); + +// Configure the HTTP request pipeline. +if (app.Environment.IsDevelopment()) { - public class Program - { - public static void Main(string[] args) - { - CreateHostBuilder(args).Build().Run(); - } - - public static IHostBuilder CreateHostBuilder(string[] args) => - Host.CreateDefaultBuilder(args) - .ConfigureLogging((context, builder) => - { - if (context.Configuration != null) - builder - .AddTelegram(context.Configuration) - .AddConsole(); - }) - .ConfigureWebHostDefaults(webBuilder => { webBuilder.UseStartup(); }); - } -} \ No newline at end of file + app.UseSwagger(); + app.UseSwaggerUI(); +} + +app.UseHttpsRedirection(); + +app.UseAuthorization(); + +app.MapControllers(); + +app.Run(); \ No newline at end of file diff --git a/examples/WebApp/Properties/launchSettings.json b/examples/WebApp/Properties/launchSettings.json index 9112ef3..942149f 100644 --- a/examples/WebApp/Properties/launchSettings.json +++ b/examples/WebApp/Properties/launchSettings.json @@ -1,28 +1,28 @@ { - "$schema": "http://json.schemastore.org/launchsettings.json", + "$schema": "https://json.schemastore.org/launchsettings.json", "iisSettings": { "windowsAuthentication": false, "anonymousAuthentication": true, "iisExpress": { - "applicationUrl": "http://localhost:40753", - "sslPort": 44356 + "applicationUrl": "http://localhost:24153", + "sslPort": 44367 } }, "profiles": { - "IIS Express": { - "commandName": "IISExpress", + "WebApp.NextVersion": { + "commandName": "Project", + "dotnetRunMessages": true, "launchBrowser": true, "launchUrl": "swagger", + "applicationUrl": "https://localhost:7065;http://localhost:5130", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" } }, - "WebApp": { - "commandName": "Project", - "dotnetRunMessages": "true", + "IIS Express": { + "commandName": "IISExpress", "launchBrowser": true, "launchUrl": "swagger", - "applicationUrl": "https://localhost:5001;http://localhost:5000", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" } diff --git a/examples/WebApp/Startup.cs b/examples/WebApp/Startup.cs deleted file mode 100644 index 01c69ba..0000000 --- a/examples/WebApp/Startup.cs +++ /dev/null @@ -1,52 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Builder; -using Microsoft.AspNetCore.Hosting; -using Microsoft.AspNetCore.HttpsPolicy; -using Microsoft.AspNetCore.Mvc; -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Hosting; -using Microsoft.Extensions.Logging; -using Microsoft.OpenApi.Models; - -namespace WebApp -{ - public class Startup - { - public Startup(IConfiguration configuration) - { - Configuration = configuration; - } - - public IConfiguration Configuration { get; } - - // This method gets called by the runtime. Use this method to add services to the container. - public void ConfigureServices(IServiceCollection services) - { - services.AddControllers(); - services.AddSwaggerGen(c => { c.SwaggerDoc("v1", new OpenApiInfo {Title = "WebApp", Version = "v1"}); }); - } - - // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. - public void Configure(IApplicationBuilder app, IWebHostEnvironment env) - { - if (env.IsDevelopment()) - { - app.UseDeveloperExceptionPage(); - app.UseSwagger(); - app.UseSwaggerUI(c => c.SwaggerEndpoint("/swagger/v1/swagger.json", "WebApp v1")); - } - - app.UseHttpsRedirection(); - - app.UseRouting(); - - app.UseAuthorization(); - - app.UseEndpoints(endpoints => { endpoints.MapControllers(); }); - } - } -} \ No newline at end of file diff --git a/examples/WebApp/WeatherForecast.cs b/examples/WebApp/WeatherForecast.cs index b8e249c..ced35b9 100644 --- a/examples/WebApp/WeatherForecast.cs +++ b/examples/WebApp/WeatherForecast.cs @@ -1,15 +1,12 @@ -using System; +namespace WebApp; -namespace WebApp +public class WeatherForecast { - public class WeatherForecast - { - public DateTime Date { get; set; } + public DateTime Date { get; set; } - public int TemperatureC { get; set; } + public int TemperatureC { get; set; } - public int TemperatureF => 32 + (int) (TemperatureC / 0.5556); + public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); - public string Summary { get; set; } - } + public string? Summary { get; set; } } \ No newline at end of file diff --git a/examples/WebApp/WebApp.csproj b/examples/WebApp/WebApp.csproj index c2d8f0b..9f5a746 100644 --- a/examples/WebApp/WebApp.csproj +++ b/examples/WebApp/WebApp.csproj @@ -1,12 +1,12 @@ - netcoreapp3.1 + net6.0 + enable + enable - - diff --git a/examples/WebApp/appsettings.Development.json b/examples/WebApp/appsettings.Development.json index 8983e0f..0c208ae 100644 --- a/examples/WebApp/appsettings.Development.json +++ b/examples/WebApp/appsettings.Development.json @@ -2,8 +2,7 @@ "Logging": { "LogLevel": { "Default": "Information", - "Microsoft": "Warning", - "Microsoft.Hosting.Lifetime": "Information" + "Microsoft.AspNetCore": "Warning" } } } diff --git a/examples/WebApp/appsettings.json b/examples/WebApp/appsettings.json index b2ff47d..1d32d4a 100644 --- a/examples/WebApp/appsettings.json +++ b/examples/WebApp/appsettings.json @@ -2,19 +2,17 @@ "Logging": { "LogLevel": { "Default": "Information", - "Microsoft": "Warning", - "Microsoft.Hosting.Lifetime": "Information" + "Microsoft.AspNetCore": "Warning" }, "Telegram": { "LogLevel": { - "Default": "Error", - "WebApp.Controllers": "Warning" + "Default": "Error" }, "AccessToken": "1234567890:AAAaaAAaa_AaAAaa-AAaAAAaAAaAaAaAAAA", "ChatId": "-0000000000000", "UseEmoji": "true", - "Source": "WebApp" + "Source": "WebApp.NextVersion" } }, "AllowedHosts": "*" -} \ No newline at end of file +} From 4d83b51438607b461ce5c858eeedfcbafe087a46 Mon Sep 17 00:00:00 2001 From: Andrew Date: Sun, 5 Mar 2023 13:09:11 +0200 Subject: [PATCH 3/9] Update language versions --- examples/ConsoleApp/ConsoleApp.csproj | 2 +- examples/WebApp/WebApp.csproj | 1 + .../X.Extensions.Logging.Telegram.csproj | 2 +- .../X.Extensions.Logging.Telegram.Tests.csproj | 2 ++ 4 files changed, 5 insertions(+), 2 deletions(-) diff --git a/examples/ConsoleApp/ConsoleApp.csproj b/examples/ConsoleApp/ConsoleApp.csproj index 2496636..547713f 100644 --- a/examples/ConsoleApp/ConsoleApp.csproj +++ b/examples/ConsoleApp/ConsoleApp.csproj @@ -3,7 +3,7 @@ Exe net6.0 - 10 + default diff --git a/examples/WebApp/WebApp.csproj b/examples/WebApp/WebApp.csproj index 9f5a746..65c8f4c 100644 --- a/examples/WebApp/WebApp.csproj +++ b/examples/WebApp/WebApp.csproj @@ -4,6 +4,7 @@ net6.0 enable enable + default diff --git a/src/X.Extensions.Logging.Telegram/X.Extensions.Logging.Telegram.csproj b/src/X.Extensions.Logging.Telegram/X.Extensions.Logging.Telegram.csproj index 7e51dcb..76ab832 100644 --- a/src/X.Extensions.Logging.Telegram/X.Extensions.Logging.Telegram.csproj +++ b/src/X.Extensions.Logging.Telegram/X.Extensions.Logging.Telegram.csproj @@ -1,7 +1,7 @@ - 10 + default Andrew Gubskiy True X.Extensions.Logging.Telegram diff --git a/tests/X.Extensions.Logging.Telegram.Tests/X.Extensions.Logging.Telegram.Tests.csproj b/tests/X.Extensions.Logging.Telegram.Tests/X.Extensions.Logging.Telegram.Tests.csproj index d77f834..fa0aae7 100644 --- a/tests/X.Extensions.Logging.Telegram.Tests/X.Extensions.Logging.Telegram.Tests.csproj +++ b/tests/X.Extensions.Logging.Telegram.Tests/X.Extensions.Logging.Telegram.Tests.csproj @@ -4,6 +4,8 @@ net6.0 false + + default From eea2584b26d9d1a33f15fe366f2d4ad801edc9a4 Mon Sep 17 00:00:00 2001 From: Andrew Date: Sun, 5 Mar 2023 13:09:48 +0200 Subject: [PATCH 4/9] Update packages --- .../X.Extensions.Logging.Telegram.csproj | 2 +- .../X.Extensions.Logging.Telegram.Tests.csproj | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/X.Extensions.Logging.Telegram/X.Extensions.Logging.Telegram.csproj b/src/X.Extensions.Logging.Telegram/X.Extensions.Logging.Telegram.csproj index 76ab832..9b350fb 100644 --- a/src/X.Extensions.Logging.Telegram/X.Extensions.Logging.Telegram.csproj +++ b/src/X.Extensions.Logging.Telegram/X.Extensions.Logging.Telegram.csproj @@ -19,7 +19,7 @@ - + diff --git a/tests/X.Extensions.Logging.Telegram.Tests/X.Extensions.Logging.Telegram.Tests.csproj b/tests/X.Extensions.Logging.Telegram.Tests/X.Extensions.Logging.Telegram.Tests.csproj index fa0aae7..b2a96f4 100644 --- a/tests/X.Extensions.Logging.Telegram.Tests/X.Extensions.Logging.Telegram.Tests.csproj +++ b/tests/X.Extensions.Logging.Telegram.Tests/X.Extensions.Logging.Telegram.Tests.csproj @@ -10,8 +10,8 @@ - - + + From af461bfeb687c098ed80617b7343af5cbf1a2408 Mon Sep 17 00:00:00 2001 From: Andrew Date: Sun, 5 Mar 2023 13:10:19 +0200 Subject: [PATCH 5/9] Update config --- examples/WebApp/appsettings.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/WebApp/appsettings.json b/examples/WebApp/appsettings.json index 1d32d4a..f1e188e 100644 --- a/examples/WebApp/appsettings.json +++ b/examples/WebApp/appsettings.json @@ -11,7 +11,7 @@ "AccessToken": "1234567890:AAAaaAAaa_AaAAaa-AAaAAAaAAaAaAaAAAA", "ChatId": "-0000000000000", "UseEmoji": "true", - "Source": "WebApp.NextVersion" + "Source": "WebApp" } }, "AllowedHosts": "*" From d92578eddc9ce1704bd783752ff9255e09d1ce0b Mon Sep 17 00:00:00 2001 From: Andrew Date: Sun, 5 Mar 2023 13:18:40 +0200 Subject: [PATCH 6/9] Remove old launchsettings --- .../WebApp/Properties/launchSettings.json | 31 ------------------- 1 file changed, 31 deletions(-) delete mode 100644 examples/WebApp/Properties/launchSettings.json diff --git a/examples/WebApp/Properties/launchSettings.json b/examples/WebApp/Properties/launchSettings.json deleted file mode 100644 index 942149f..0000000 --- a/examples/WebApp/Properties/launchSettings.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "$schema": "https://json.schemastore.org/launchsettings.json", - "iisSettings": { - "windowsAuthentication": false, - "anonymousAuthentication": true, - "iisExpress": { - "applicationUrl": "http://localhost:24153", - "sslPort": 44367 - } - }, - "profiles": { - "WebApp.NextVersion": { - "commandName": "Project", - "dotnetRunMessages": true, - "launchBrowser": true, - "launchUrl": "swagger", - "applicationUrl": "https://localhost:7065;http://localhost:5130", - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } - }, - "IIS Express": { - "commandName": "IISExpress", - "launchBrowser": true, - "launchUrl": "swagger", - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } - } - } -} From 9c08c6f13919e4a94936eb3b743a62c35bb6a108 Mon Sep 17 00:00:00 2001 From: Andrew Date: Sun, 5 Mar 2023 13:34:06 +0200 Subject: [PATCH 7/9] Update project settings --- .../X.Extensions.Logging.Telegram.csproj | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/X.Extensions.Logging.Telegram/X.Extensions.Logging.Telegram.csproj b/src/X.Extensions.Logging.Telegram/X.Extensions.Logging.Telegram.csproj index 9b350fb..dd1b163 100644 --- a/src/X.Extensions.Logging.Telegram/X.Extensions.Logging.Telegram.csproj +++ b/src/X.Extensions.Logging.Telegram/X.Extensions.Logging.Telegram.csproj @@ -12,13 +12,13 @@ telegram, logging, log, logs, tg Telegram logging provider git - 1.0.5.1 - netstandard2.0 + 1.0.5.1 1.0.5.1 + net6.0;net7.0;netstandard2.0;netstandard2.1 - + From c3204431dcc18239de279146daae3297ade87a52 Mon Sep 17 00:00:00 2001 From: Andrew Date: Sun, 5 Mar 2023 13:37:24 +0200 Subject: [PATCH 8/9] Format code --- src/X.Extensions.Logging.Telegram/TelegramLogger.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/X.Extensions.Logging.Telegram/TelegramLogger.cs b/src/X.Extensions.Logging.Telegram/TelegramLogger.cs index 634a300..52b6854 100644 --- a/src/X.Extensions.Logging.Telegram/TelegramLogger.cs +++ b/src/X.Extensions.Logging.Telegram/TelegramLogger.cs @@ -17,6 +17,7 @@ internal TelegramLogger( ITelegramMessageFormatter formatter) { Options = options ?? throw new ArgumentNullException(nameof(options)); + _logLevelChecker = logLevelChecker; _queueProcessor = loggerProcessor; _formatter = formatter; From 89c2553724d81f5d9dfbfbe9e3a4b7bb3cf021f0 Mon Sep 17 00:00:00 2001 From: Andrew Date: Sun, 5 Mar 2023 15:09:05 +0200 Subject: [PATCH 9/9] Update project version and README.md --- README.md | 6 ++++++ .../X.Extensions.Logging.Telegram.csproj | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9358681..f6e722b 100644 --- a/README.md +++ b/README.md @@ -102,3 +102,9 @@ logBuilder.AddTelegram(options, CreateFormatter); ``` For using custom message formatter delegate Func should be passed to extensions method AddTelegram. Delegate should be used because formatter needs to know which category is used for rendering the message. + + +## Get a digital subscription for project news +[Subscribe](https://twitter.com/intent/user?screen_name=andrew_gubskiy) to my Twitter to keep up-to-date with project news and receive announcements. + +[![Twitter URL](https://img.shields.io/twitter/url/https/twitter.com/andrew_gubskiy.svg?style=social&label=Follow%20%40andrew_gubskiy)](https://twitter.com/andrew_gubskiy) \ No newline at end of file diff --git a/src/X.Extensions.Logging.Telegram/X.Extensions.Logging.Telegram.csproj b/src/X.Extensions.Logging.Telegram/X.Extensions.Logging.Telegram.csproj index dd1b163..2c3a55c 100644 --- a/src/X.Extensions.Logging.Telegram/X.Extensions.Logging.Telegram.csproj +++ b/src/X.Extensions.Logging.Telegram/X.Extensions.Logging.Telegram.csproj @@ -12,8 +12,8 @@ telegram, logging, log, logs, tg Telegram logging provider git - 1.0.5.1 - 1.0.5.1 + 1.0.6.1 + 1.0.6.1 net6.0;net7.0;netstandard2.0;netstandard2.1