Skip to content

Commit 4d2f1fa

Browse files
committed
Update project to VS2017
1 parent 1c71422 commit 4d2f1fa

File tree

8 files changed

+49
-214
lines changed

8 files changed

+49
-214
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
*.suo
66
*.user
77
*.sln.docstates
8+
*.bak
89

910
# Build results
1011
[Dd]ebug/

appveyor.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
version: '{build}'
22
skip_tags: true
3-
image: Visual Studio 2015
3+
image: Visual Studio 2017
44
configuration: Release
55
install:
66
- ps: mkdir -Force ".\build\" | Out-Null
7-
- ps: Invoke-WebRequest "https://raw.githubusercontent.com/dotnet/cli/rel/1.0.0-preview2/scripts/obtain/dotnet-install.ps1" -OutFile ".\build\installcli.ps1"
7+
- ps: Invoke-WebRequest "https://raw.githubusercontent.com/dotnet/cli/rel/1.0.1/scripts/obtain/dotnet-install.ps1" -OutFile ".\build\installcli.ps1"
88
- ps: $env:DOTNET_INSTALL_DIR = "$pwd\.dotnetcli"
9-
- ps: '& .\build\installcli.ps1 -InstallDir "$env:DOTNET_INSTALL_DIR" -NoPath -Version 1.0.0-preview2-003121'
9+
- ps: '& .\build\installcli.ps1 -InstallDir "$env:DOTNET_INSTALL_DIR" -NoPath -Version 1.0.1'
1010
- ps: $env:Path = "$env:DOTNET_INSTALL_DIR;$env:Path"
1111
build_script:
1212
- ps: ./Build.ps1

serilog-sinks-mysql.sln

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
1+
22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio 14
4-
VisualStudioVersion = 14.0.25420.1
3+
# Visual Studio 15
4+
VisualStudioVersion = 15.0.26114.2
55
MinimumVisualStudioVersion = 10.0.40219.1
6-
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Serilog.Sinks.MySQL", "src\Serilog.Sinks.MySQL\Serilog.Sinks.MySQL.xproj", "{FC74732C-4199-4D17-B89E-76AB37B71BFC}"
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Serilog.Sinks.MySQL", "src\Serilog.Sinks.MySQL\Serilog.Sinks.MySQL.csproj", "{FC74732C-4199-4D17-B89E-76AB37B71BFC}"
77
EndProject
88
Global
99
GlobalSection(SolutionConfigurationPlatforms) = preSolution

src/Serilog.Sinks.MySQL/Properties/AssemblyInfo.cs

Lines changed: 0 additions & 35 deletions
This file was deleted.
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<AssemblyTitle>Serilog.Sinks.MySQL</AssemblyTitle>
5+
<Authors>Saleem Mirza</Authors>
6+
<AssemblyName>Serilog.Sinks.MySQL</AssemblyName>
7+
<Description>Serilog event sink that writes to MySQL database</Description>
8+
<PackageId>Serilog.Sinks.MySQL</PackageId>
9+
<PackageTags>serilog;logging;MySQL</PackageTags>
10+
<PackageIconUrl>http://serilog.net/images/serilog-sink-nuget.png</PackageIconUrl>
11+
<PackageProjectUrl>http://serilog.net</PackageProjectUrl>
12+
<PackageLicenseUrl>http://www.apache.org/licenses/LICENSE-2.0</PackageLicenseUrl>
13+
<Copyright>Copyright © Zethian Inc. 2013-2017</Copyright>
14+
<AssemblyVersion>2.7.0.0</AssemblyVersion>
15+
<Version>2.7.0</Version>
16+
<SignAssembly>True</SignAssembly>
17+
<AssemblyOriginatorKeyFile>Serilog.snk</AssemblyOriginatorKeyFile>
18+
<TargetFrameworks>net45</TargetFrameworks>
19+
</PropertyGroup>
20+
21+
<PropertyGroup Condition="'$(VersionSuffix)'!='' ">
22+
<Version>$(Version)-$(VersionSuffix)</Version>
23+
</PropertyGroup>
24+
25+
<ItemGroup>
26+
<PackageReference Include="MySql.Data" Version="6.9.9" />
27+
<PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
28+
<PackageReference Include="Serilog" Version="2.4.0" />
29+
<PackageReference Include="System.Data.Common" Version="4.3.0" />
30+
</ItemGroup>
31+
32+
<ItemGroup Condition=" '$(TargetFramework)' == 'net45' ">
33+
<Reference Include="System" />
34+
<Reference Include="Microsoft.CSharp" />
35+
</ItemGroup>
36+
37+
<ItemGroup>
38+
<Folder Include="Properties\" />
39+
</ItemGroup>
40+
41+
</Project>

src/Serilog.Sinks.MySQL/Serilog.Sinks.MySQL.xproj

Lines changed: 0 additions & 18 deletions
This file was deleted.

src/Serilog.Sinks.MySQL/Sinks/Batch/BatchProvider.cs

Lines changed: 0 additions & 121 deletions
Original file line numberDiff line numberDiff line change
@@ -22,126 +22,6 @@
2222

2323
namespace Serilog.Sinks.Batch
2424
{
25-
#if NET452
26-
27-
internal abstract class BatchProvider : IDisposable
28-
{
29-
private readonly uint _batchSize;
30-
private readonly CancellationTokenSource _cancellationToken = new CancellationTokenSource();
31-
private readonly List<LogEvent> _logEventBatch;
32-
private readonly BlockingCollection<IList<LogEvent>> _messageQueue;
33-
private readonly TimeSpan _thresholdTimeSpan = TimeSpan.FromSeconds(10);
34-
private readonly AutoResetEvent _timerResetEvent = new AutoResetEvent(false);
35-
private readonly Task _timerTask;
36-
private readonly List<Thread> _workerThreads;
37-
38-
private bool _canStop;
39-
40-
protected BatchProvider(uint batchSize = 100, int nThreads = 1)
41-
{
42-
_batchSize = batchSize;
43-
_logEventBatch = new List<LogEvent>();
44-
_messageQueue = new BlockingCollection<IList<LogEvent>>();
45-
_workerThreads = new List<Thread>();
46-
47-
var maxThreads = Math.Max(1, Math.Min(nThreads, Environment.ProcessorCount));
48-
for (var i = 0; i < maxThreads; i++)
49-
{
50-
var workerThread = new Thread(Pump)
51-
{
52-
IsBackground = true
53-
};
54-
workerThread.Start();
55-
_workerThreads.Add(workerThread);
56-
}
57-
58-
_timerTask = Task.Factory.StartNew(TimerPump);
59-
}
60-
61-
private void Pump()
62-
{
63-
try
64-
{
65-
while (true)
66-
{
67-
var logEvents = _messageQueue.Take(_cancellationToken.Token);
68-
WriteLogEvent(logEvents);
69-
}
70-
}
71-
catch (OperationCanceledException)
72-
{
73-
_canStop = true;
74-
_timerResetEvent.Set();
75-
_timerTask.Wait();
76-
77-
IList<LogEvent> eventBatch;
78-
while (_messageQueue.TryTake(out eventBatch))
79-
WriteLogEvent(eventBatch);
80-
}
81-
catch (Exception e)
82-
{
83-
SelfLog.WriteLine(e.Message);
84-
}
85-
}
86-
87-
private void TimerPump()
88-
{
89-
while (!_canStop)
90-
{
91-
_timerResetEvent.WaitOne(_thresholdTimeSpan);
92-
FlushLogEventBatch();
93-
}
94-
}
95-
96-
private void FlushLogEventBatch()
97-
{
98-
lock (this)
99-
{
100-
_messageQueue.Add(_logEventBatch.ToArray());
101-
_logEventBatch.Clear();
102-
}
103-
}
104-
105-
protected void PushEvent(LogEvent logEvent)
106-
{
107-
_logEventBatch.Add(logEvent);
108-
if (_logEventBatch.Count >= _batchSize)
109-
FlushLogEventBatch();
110-
}
111-
112-
protected abstract void WriteLogEvent(ICollection<LogEvent> logEventsBatch);
113-
114-
#region IDisposable Support
115-
116-
private bool _disposedValue; // To detect redundant calls
117-
118-
protected virtual void Dispose(bool disposing)
119-
{
120-
if (!_disposedValue)
121-
{
122-
if (disposing)
123-
{
124-
SelfLog.WriteLine("Halting sink...");
125-
_cancellationToken.Cancel();
126-
foreach (var workerThread in _workerThreads)
127-
workerThread.Join();
128-
SelfLog.WriteLine("Sink halted successfully.");
129-
}
130-
131-
_disposedValue = true;
132-
}
133-
}
134-
135-
public void Dispose()
136-
{
137-
Dispose(true);
138-
}
139-
140-
#endregion
141-
}
142-
#elif NETSTANDARD1_6
143-
144-
14525
internal abstract class BatchProvider : IDisposable
14626
{
14727
private readonly uint _batchSize;
@@ -255,5 +135,4 @@ public void Dispose()
255135

256136
#endregion
257137
}
258-
#endif
259138
}

src/Serilog.Sinks.MySQL/project.json

Lines changed: 0 additions & 33 deletions
This file was deleted.

0 commit comments

Comments
 (0)