Add license to the files + rename some classes

This commit is contained in:
lukeIam committed 2018-01-19 21:17:25 +01:00
1 parent 611a5b35e7
commit 919a79b8b2
10 files changed
+172 -22

No files matched your search

+18 -1
View File
@@ -1,4 +1,21 @@
using System;
#region license
// This file is part of Vocaluxe.
//
// Vocaluxe is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Vocaluxe is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Vocaluxe. If not, see <http://www.gnu.org/licenses/>.
#endregion
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Text;
+18 -1
View File
@@ -1,4 +1,21 @@
using System;
#region license
// This file is part of Vocaluxe.
//
// Vocaluxe is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Vocaluxe is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Vocaluxe. If not, see <http://www.gnu.org/licenses/>.
#endregion
using System;
using System.Diagnostics;
using VocaluxeLib.Utils;
+26 -10
View File
@@ -1,6 +1,22 @@
using System;
#region license
// This file is part of Vocaluxe.
//
// Vocaluxe is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Vocaluxe is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Vocaluxe. If not, see <http://www.gnu.org/licenses/>.
#endregion
using System;
using System.IO;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using Serilog;
@@ -15,8 +31,8 @@ namespace VocaluxeLib.Log
private static readonly StringBuilder _MainLogStringBuilder = new StringBuilder();
private static readonly StringWriter _MainLogStringWriter = new StringWriter(_MainLogStringBuilder);
private static ILogger _MainLog = new SilentLogger();
private static ILogger _SongLog = new SilentLogger();
private static ILogger _MainLog = new CSilentLogger();
private static ILogger _SongLog = new CSilentLogger();
private static string _LogFolder;
private static string _CrashMarkerFilePath;
private static ShowReporterDelegate _ShowReporterFunc;
@@ -63,8 +79,8 @@ namespace VocaluxeLib.Log
// Write new marker
File.WriteAllText(_CrashMarkerFilePath, _CurrentVersion, Encoding.UTF8);
LogFileRoller.RollLogs(mainLogFilePath, 2);
LogFileRoller.RollLogs(songLogFilePath, 2);
CLogFileRoller.RollLogs(mainLogFilePath, 2);
CLogFileRoller.RollLogs(songLogFilePath, 2);
_MainLog = new LoggerConfiguration()
.Enrich.WithThreadId()
@@ -88,19 +104,19 @@ namespace VocaluxeLib.Log
public static void Close()
{
if (!(_MainLog is SilentLogger))
if (!(_MainLog is CSilentLogger))
{
ILogger loggerToDispose = _MainLog;
_MainLog = new SilentLogger();
_MainLog = new CSilentLogger();
(_MainLog as IDisposable)?.Dispose();
}
if (!(_SongLog is SilentLogger))
if (!(_SongLog is CSilentLogger))
{
ILogger loggerToDispose = _MainLog;
_SongLog = new SilentLogger();
_SongLog = new CSilentLogger();
(_SongLog as IDisposable)?.Dispose();
}
+18 -1
View File
@@ -1,4 +1,21 @@
using System;
#region license
// This file is part of Vocaluxe.
//
// Vocaluxe is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Vocaluxe is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Vocaluxe. If not, see <http://www.gnu.org/licenses/>.
#endregion
using System;
using System.Diagnostics.CodeAnalysis;
using System.Runtime.CompilerServices;
using Serilog.Context;
+34 -1
View File
@@ -1,9 +1,42 @@
<#@ template debug="false" hostspecific="false" language="C#" #>
<#
// This file is part of Vocaluxe.
//
// Vocaluxe is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Vocaluxe is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Vocaluxe. If not, see <http://www.gnu.org/licenses/>.
#>
<#@ template debug="false" hostspecific="false" language="C#" #>
<#@ assembly name="System.Core" #>
<#@ import namespace="System.Linq" #>
<#@ import namespace="System.Text" #>
<#@ import namespace="System.Collections.Generic" #>
<#@ output extension=".cs" #>
#region license
// This file is part of Vocaluxe.
//
// Vocaluxe is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Vocaluxe is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Vocaluxe. If not, see <http://www.gnu.org/licenses/>.
#endregion
using System;
using System.Diagnostics.CodeAnalysis;
using System.Runtime.CompilerServices;
@@ -1,4 +1,21 @@
using System;
#region license
// This file is part of Vocaluxe.
//
// Vocaluxe is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Vocaluxe is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Vocaluxe. If not, see <http://www.gnu.org/licenses/>.
#endregion
using System;
using Serilog;
using Serilog.Configuration;
using Serilog.Core;
@@ -6,7 +23,7 @@ using Serilog.Events;
namespace VocaluxeLib.Log.Enricher
{
public static class WithTimeStampFromStartExtension
public static class CWithTimeStampFromStartExtension
{
// ReSharper disable once InconsistentNaming
public static LoggerConfiguration WithTimeStampFromStart(this LoggerEnrichmentConfiguration enrich)
@@ -1,11 +1,28 @@
using System;
#region license
// This file is part of Vocaluxe.
//
// Vocaluxe is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Vocaluxe is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Vocaluxe. If not, see <http://www.gnu.org/licenses/>.
#endregion
using System;
using System.Collections.Generic;
using System.IO;
using System.Text.RegularExpressions;
namespace VocaluxeLib.Log.Rolling
{
static class LogFileRoller
static class CLogFileRoller
{
public static void RollLogs(string mainLogFile, int numLogsToKeep)
{
@@ -22,7 +22,7 @@ using Serilog.Events;
namespace VocaluxeLib.Log.Serilog
{
class SilentLogger : ILogger
class CSilentLogger : ILogger
{
public ILogger ForContext(ILogEventEnricher enricher)
{
+17 -1
View File
@@ -1,4 +1,20 @@
#region license
// This file is part of Vocaluxe.
//
// Vocaluxe is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Vocaluxe is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Vocaluxe. If not, see <http://www.gnu.org/licenses/>.
#endregion
namespace VocaluxeLib.Log
{
/// <summary>
+2 -2
View File
@@ -119,8 +119,8 @@
<Compile Include="GlobalSuppressions.cs" />
<Compile Include="IBasic.cs" />
<Compile Include="Log\Enricher\CTimeStampFromStartEnricher.cs" />
<Compile Include="Log\Rolling\LogRoller.cs" />
<Compile Include="Log\Serilog\SilentLogger.cs" />
<Compile Include="Log\Rolling\CLogFileRoller.cs" />
<Compile Include="Log\Serilog\CSilentLogger.cs" />
<Compile Include="Log\CLogFunctions.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>