-
Notifications
You must be signed in to change notification settings - Fork 105
Switch to Microsoft.Extensions.Logging.Abstractions #191
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<Project> | ||
<PropertyGroup> | ||
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally> | ||
</PropertyGroup> | ||
|
||
<PropertyGroup> | ||
<PublishRepositoryUrl>true</PublishRepositoryUrl> | ||
<EmbedUntrackedSources>true</EmbedUntrackedSources> | ||
<IncludeSymbols>true</IncludeSymbols> | ||
<SymbolPackageFormat>snupkg</SymbolPackageFormat> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.SourceLink.GitHub" PrivateAssets="All"/> | ||
</ItemGroup> | ||
</Project> |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,15 @@ | ||||||
<Project> | ||||||
<ItemGroup> | ||||||
<PackageVersion Include="Serilog" Version="2.10.0" /> | ||||||
<PackageVersion Include="Serilog.Sinks.Console" Version="3.1.1" /> | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="5.0.0" /> | ||||||
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="5.0.0" /> | ||||||
<PackageVersion Include="Microsoft.Extensions.Logging" Version="5.0.0" /> | ||||||
<PackageVersion Include="Microsoft.Extensions.Logging.Console" Version="5.0.0" /> | ||||||
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="16.10.0" /> | ||||||
<PackageVersion Include="xunit.runner.visualstudio" Version="2.4.3" /> | ||||||
<PackageVersion Include="xunit" Version="2.4.1" /> | ||||||
<PackageVersion Include="BenchmarkDotNet" Version="0.13.0" /> | ||||||
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="1.0.0" /> | ||||||
</ItemGroup> | ||||||
</Project> |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// Copyright 2017 Serilog Contributors | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
using Microsoft.Extensions.Logging; | ||
using Serilog.Extensions.Logging; | ||
|
||
namespace Serilog | ||
{ | ||
/// <inherit /> | ||
[ProviderAlias("Serilog")] | ||
public class AliasedSerilogLoggerProvider : SerilogLoggerProvider | ||
{ | ||
/// <inherit /> | ||
public AliasedSerilogLoggerProvider(ILogger logger = null, bool dispose = false) | ||
: base(logger, dispose) | ||
{ | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. New project containing only single file? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @Cheesebaron If you want to get rid of internal static class ProviderAliasUtilities
{
private const string AliasAttibuteTypeFullName = "Microsoft.Extensions.Logging.ProviderAliasAttribute";
internal static string GetAlias(Type providerType)
{
foreach (CustomAttributeData attributeData in CustomAttributeData.GetCustomAttributes(providerType))
{
if (attributeData.AttributeType.FullName == AliasAttibuteTypeFullName)
{
foreach (CustomAttributeTypedArgument arg in attributeData.ConstructorArguments)
{
Debug.Assert(arg.ArgumentType == typeof(string));
return arg.Value?.ToString();
}
}
}
return null;
}
} 😉 I will not tell you exactly why they did that, but since they did it, then the reason was and why not use such a opportunity? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
||
<PropertyGroup> | ||
<Description>Low-level Serilog provider for Microsoft.Extensions.Logging</Description> | ||
<VersionPrefix>3.0.2</VersionPrefix> | ||
<Authors>Microsoft;Serilog Contributors</Authors> | ||
<TargetFramework>netstandard2.0</TargetFramework> | ||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors> | ||
<GenerateDocumentationFile>true</GenerateDocumentationFile> | ||
<AssemblyName>Serilog.Extensions.Logging.Extensions</AssemblyName> | ||
<AssemblyOriginatorKeyFile>../../assets/Serilog.snk</AssemblyOriginatorKeyFile> | ||
<SignAssembly>true</SignAssembly> | ||
<PublicSign Condition=" '$(OS)' != 'Windows_NT' ">true</PublicSign> | ||
<PackageId>Serilog.Extensions.Logging.Extensions</PackageId> | ||
<PackageTags>serilog;Microsoft.Extensions.Logging</PackageTags> | ||
<PackageIcon>serilog-extension-nuget.png</PackageIcon> | ||
<PackageProjectUrl>https://github.com/serilog/serilog-extensions-logging</PackageProjectUrl> | ||
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression> | ||
<RepositoryUrl>https://github.com/serilog/serilog-extensions-logging</RepositoryUrl> | ||
<RepositoryType>git</RepositoryType> | ||
<GenerateAssemblyVersionAttribute>false</GenerateAssemblyVersionAttribute> | ||
<RootNamespace>Serilog</RootNamespace> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<None Include="..\..\assets\serilog-extension-nuget.png" Pack="true" PackagePath="" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.Extensions.Logging" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\Serilog.Extensions.Logging\Serilog.Extensions.Logging.csproj" /> | ||
</ItemGroup> | ||
|
||
</Project> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
project uses two-spaces indentation for other csprojs