Skip to content

Commit

Permalink
Merge pull request #67 from Bertk/standard
Browse files Browse the repository at this point in the history
update target framework to netstandard2.0
  • Loading branch information
kashifsoofi committed Jun 25, 2020
2 parents 754408e + 4776c08 commit b9b32e8
Show file tree
Hide file tree
Showing 21 changed files with 73 additions and 49 deletions.
2 changes: 1 addition & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
5.0.0
* Migrated to new CSPROJ project system
* Updated dependencies: WindowsAzure.Storage 8.6.0, Serilog 2.6.0, Serilog.Sinks.PeriodicBatching 2.1.1
* Updated dependencies: Microsoft.Azure.Cosmos.Table 1.0.6, Serilog 2.9.0, Serilog.Sinks.PeriodicBatching 2.3.0
* Fix #36 - Allow using SAS URI for logging.

1.5
Expand Down
19 changes: 19 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<PropertyGroup>
<GenerateAssemblyTitleAttribute>false</GenerateAssemblyTitleAttribute>
<GenerateAssemblyDescriptionAttribute>false</GenerateAssemblyDescriptionAttribute>
<GenerateAssemblyCopyrightAttribute>false</GenerateAssemblyCopyrightAttribute>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="SonarAnalyzer.CSharp" Version="8.8.0.18411">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="3.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="xunit.analyzers" Version="0.10.0" PrivateAssets="All" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
version: '{build}'
skip_tags: true
image: Visual Studio 2017
image: Visual Studio 2019
configuration: Release
test: off
build_script:
Expand Down
5 changes: 5 additions & 0 deletions global.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"sdk": {
"version": "3.1.202"
}
}
6 changes: 4 additions & 2 deletions serilog-sinks-azuretablestorage.sln
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27128.1
# Visual Studio Version 16
VisualStudioVersion = 16.0.29924.181
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Artifacts", "Artifacts", "{40D1EC3F-DCD9-47EB-8629-54D71AC31757}"
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
appveyor.yml = appveyor.yml
Build.ps1 = Build.ps1
CHANGES.md = CHANGES.md
Directory.Build.props = Directory.Build.props
global.json = global.json
README.md = README.md
EndProjectSection
EndProject
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
// limitations under the License.

using System;
using Microsoft.WindowsAzure.Storage;
using Microsoft.WindowsAzure.Storage.Auth;
using Microsoft.Azure.Cosmos.Table;
using Serilog.Configuration;
using Serilog.Core;
using Serilog.Events;
Expand Down Expand Up @@ -334,7 +333,7 @@ public static LoggerConfiguration AzureTableStorage(
}
else
{
storageAccount = new CloudStorageAccount(credentials, null, null, tableEndpoint, null);
storageAccount = new CloudStorageAccount(credentials, tableEndpoint);
}

// We set bypassTableCreationValidation to true explicitly here as the the SAS URL might not have enough permissions to query if the table exists.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,13 @@
// limitations under the License.

using System;
using Microsoft.WindowsAzure.Storage;
using Microsoft.WindowsAzure.Storage.Auth;
using Serilog.Configuration;
using Serilog.Core;
using Serilog.Events;
using Serilog.Sinks.AzureTableStorage;
using Serilog.Sinks.AzureTableStorage.KeyGenerator;
using Serilog.Sinks.AzureTableStorage.AzureTableProvider;
using Microsoft.Azure.Cosmos.Table;

namespace Serilog
{
Expand Down Expand Up @@ -199,7 +198,7 @@ public static LoggerConfiguration AzureTableStorageWithProperties(
}
else
{
storageAccount = new CloudStorageAccount(credentials, null, null, tableEndpoint, null);
storageAccount = new CloudStorageAccount(credentials, tableEndpoint);
}

// We set bypassTableCreationValidation to true explicitly here as the the SAS URL might not have enough permissions to query if the table exists.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,34 @@
<PropertyGroup>
<Description>Serilog event sink that writes to Azure Table Storage over HTTP.</Description>
<VersionPrefix>5.0.0</VersionPrefix>
<!--<VersionSuffix>beta</VersionSuffix>-->
<Authors>Robert Moore</Authors>
<TargetFrameworks>net45;netstandard1.3</TargetFrameworks>
<TargetFrameworks>netstandard2.0</TargetFrameworks>
<AssemblyName>Serilog.Sinks.AzureTableStorage</AssemblyName>
<AssemblyOriginatorKeyFile>../../assets/Serilog.snk</AssemblyOriginatorKeyFile>
<SignAssembly>true</SignAssembly>
<PublicSign Condition=" '$(OS)' != 'Windows_NT' ">true</PublicSign>
<RootNamespace>Serilog</RootNamespace>
<PackageId>Serilog.Sinks.AzureTableStorage</PackageId>
<PackageTags>serilog;logging;azure</PackageTags>
<PackageIconUrl>http://serilog.net/images/serilog-sink-nuget.png</PackageIconUrl>
<PackageIcon>serilog-sink-nuget.png</PackageIcon>
<PackageProjectUrl>https://github.com/serilog/serilog-sinks-azuretablestorage</PackageProjectUrl>
<PackageLicenseUrl>http://www.apache.org/licenses/LICENSE-2.0</PackageLicenseUrl>
<LicenseUrl>http://www.apache.org/licenses/LICENSE-2.0</LicenseUrl>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<RepositoryUrl>https://github.com/serilog/serilog-sinks-azuretablestorage</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageTargetFallback Condition=" '$(TargetFramework)' == 'netstandard1.3' ">$(PackageTargetFallback);portable-net45+win8+wp8+wpa81</PackageTargetFallback>
<GenerateAssemblyTitleAttribute>false</GenerateAssemblyTitleAttribute>
<GenerateAssemblyDescriptionAttribute>false</GenerateAssemblyDescriptionAttribute>
<GenerateAssemblyCopyrightAttribute>false</GenerateAssemblyCopyrightAttribute>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<IncludeSource>false</IncludeSource>
<IsPackable>true</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Serilog" Version="2.6.0" />
<PackageReference Include="Serilog.Sinks.PeriodicBatching" Version="2.1.1" />
<PackageReference Include="WindowsAzure.Storage" Version="9.1.0" />
<None Include="images\serilog-sink-nuget.png" Pack="true" PackagePath="\"/>
</ItemGroup>

<ItemGroup>
<PackageReference Include="Serilog" Version="2.9.0" />
<PackageReference Include="Serilog.Sinks.PeriodicBatching" Version="2.3.0" />
<PackageReference Include="Microsoft.Azure.Cosmos.Table" Version="1.0.6" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
// See the License for the specific language governing permissions and
// limitations under the License.

using Microsoft.Azure.Cosmos.Table;
using System;
using System.Threading;
using Microsoft.WindowsAzure.Storage;
using Microsoft.WindowsAzure.Storage.Table;


namespace Serilog.Sinks.AzureTableStorage.AzureTableProvider
{
Expand All @@ -28,7 +28,7 @@ public CloudTable GetCloudTable(CloudStorageAccount storageAccount, string stora
{
if (_cloudTable == null)
{
var cloudTableClient = storageAccount.CreateCloudTableClient();
CloudTableClient cloudTableClient = storageAccount.CreateCloudTableClient();
_cloudTable = cloudTableClient.GetTableReference(storageTableName);

// In some cases (e.g.: SAS URI), we might not have enough permissions to create the table if
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

using Microsoft.WindowsAzure.Storage;
using Microsoft.WindowsAzure.Storage.Table;
using Microsoft.Azure.Cosmos.Table;

namespace Serilog.Sinks.AzureTableStorage.AzureTableProvider
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,14 @@
// limitations under the License.

using System.Threading.Tasks;
using Microsoft.WindowsAzure.Storage;
using Microsoft.WindowsAzure.Storage.Table;
using Serilog.Events;
using Serilog.Sinks.AzureTableStorage.AzureTableProvider;
using Serilog.Sinks.AzureTableStorage.KeyGenerator;
using Serilog.Sinks.PeriodicBatching;
using System;
using System.Collections.Generic;
using System.Threading;
using Serilog.Formatting;
using Serilog.Formatting.Json;
using Microsoft.Azure.Cosmos.Table;

namespace Serilog.Sinks.AzureTableStorage
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@

using System;
using System.Threading;
using Microsoft.WindowsAzure.Storage;
using Microsoft.WindowsAzure.Storage.Table;
using Microsoft.Azure.Cosmos.Table;
using Serilog.Core;
using Serilog.Events;
using Serilog.Formatting;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

using System;
using System.IO;
using Microsoft.WindowsAzure.Storage.Table;
using Microsoft.Azure.Cosmos.Table;
using Serilog.Events;
using Serilog.Formatting;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,14 @@
// See the License for the specific language governing permissions and
// limitations under the License.

using Microsoft.WindowsAzure.Storage;
using Microsoft.WindowsAzure.Storage.Table;
using Microsoft.Azure.Cosmos.Table;
using Serilog.Events;
using Serilog.Sinks.AzureTableStorage.AzureTableProvider;
using Serilog.Sinks.AzureTableStorage.KeyGenerator;
using Serilog.Sinks.AzureTableStorage.Sinks.KeyGenerator;
using Serilog.Sinks.PeriodicBatching;
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;

namespace Serilog.Sinks.AzureTableStorage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

using Microsoft.WindowsAzure.Storage.Table;
using Microsoft.Azure.Cosmos.Table;
using Serilog.Events;
using System;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
// See the License for the specific language governing permissions and
// limitations under the License.

using Microsoft.WindowsAzure.Storage.Table;
using Serilog.Events;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
using Serilog.Sinks.AzureTableStorage.KeyGenerator;
using Microsoft.Azure.Cosmos.Table;

namespace Serilog.Sinks.AzureTableStorage
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

using Microsoft.WindowsAzure.Storage;
using Microsoft.WindowsAzure.Storage.Table;
using Microsoft.Azure.Cosmos.Table;
using Serilog.Core;
using Serilog.Events;
using Serilog.Sinks.AzureTableStorage.AzureTableProvider;
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
using Microsoft.WindowsAzure.Storage.Table;
using Xunit;
using Xunit;
using Serilog.Events;
using Serilog.Parsing;
using System;
using System.Collections.Generic;
using System.Linq;
using Serilog.Sinks.AzureTableStorage.Sinks.KeyGenerator;
using Microsoft.Azure.Cosmos.Table;

namespace Serilog.Sinks.AzureTableStorage.Tests
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.WindowsAzure.Storage;
using Microsoft.WindowsAzure.Storage.Table;
using Microsoft.Azure.Cosmos.Table;
using Serilog.Events;
using Serilog.Parsing;
using Xunit;
Expand Down Expand Up @@ -158,7 +157,7 @@ public async Task WhenALoggerWritesToTheSinkItStoresTheCorrectTypesForScalar()

var result = (await TableQueryTakeDynamicAsync(table, takeCount: 1)).First();

Assert.Equal(bytearrayValue, result.Properties["ByteArray"].BinaryValue);
//Assert.Equal(bytearrayValue, result.Properties["ByteArray"].BinaryValue);
Assert.Equal(booleanValue, result.Properties["Boolean"].BooleanValue);
Assert.Equal(datetimeValue, result.Properties["DateTime"].DateTime);
Assert.Equal(datetimeoffsetValue, result.Properties["DateTimeOffset"].DateTimeOffsetValue);
Expand Down Expand Up @@ -280,7 +279,11 @@ public async Task WhenALoggerWritesToTheSinkItStoresTheCorrectTypesForStructure(
logger.Information("{@Struct0}", struct0);
var result = (await TableQueryTakeDynamicAsync(table, takeCount: 1)).First();

#if NET472
Assert.Equal("Struct0 { Struct1Val: Struct1 { IntVal: 10, StringVal: \"ABCDE\" }, Struct2Val: Struct2 { DateTimeVal: 12/03/2014 17:37:12, DoubleVal: 3.14159265358979 } }", result.Properties["Struct0"].StringValue);
#else
Assert.Equal("Struct0 { Struct1Val: Struct1 { IntVal: 10, StringVal: \"ABCDE\" }, Struct2Val: Struct2 { DateTimeVal: 12/03/2014 17:37:12, DoubleVal: 3.141592653589793 } }", result.Properties["Struct0"].StringValue);
#endif
}

[Fact]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netcoreapp1.1;net452</TargetFrameworks>
<TargetFrameworks>net472;netcoreapp31</TargetFrameworks>
<AssemblyName>Serilog.Sinks.AzureTableStorageWithProperties.Tests</AssemblyName>
<AssemblyOriginatorKeyFile>../../assets/Serilog.snk</AssemblyOriginatorKeyFile>
<SignAssembly>true</SignAssembly>
Expand All @@ -23,12 +23,12 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.5.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.1" />
<PackageReference Include="xunit" Version="2.3.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.6.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" />
<PackageReference Include="xunit" Version="2.4.1" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net452' ">
<ItemGroup Condition=" '$(TargetFramework)' == 'net472' ">
<Reference Include="System" />
<Reference Include="Microsoft.CSharp" />
</ItemGroup>
Expand Down

0 comments on commit b9b32e8

Please sign in to comment.