diff --git a/AntiAircraftGun/AntiAircraftGun/AntiAircraftGun.csproj b/AntiAircraftGun/AntiAircraftGun/AntiAircraftGun.csproj
index 3eb1f1d..3483561 100644
--- a/AntiAircraftGun/AntiAircraftGun/AntiAircraftGun.csproj
+++ b/AntiAircraftGun/AntiAircraftGun/AntiAircraftGun.csproj
@@ -8,22 +8,16 @@
enable
-
-
-
-
-
-
- Always
-
-
-
+
+
+
+
diff --git a/AntiAircraftGun/AntiAircraftGun/Program.cs b/AntiAircraftGun/AntiAircraftGun/Program.cs
index f03c116..7b43459 100644
--- a/AntiAircraftGun/AntiAircraftGun/Program.cs
+++ b/AntiAircraftGun/AntiAircraftGun/Program.cs
@@ -1,6 +1,8 @@
+using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using NLog.Extensions.Logging;
+using Serilog;
namespace AntiAircraftGun
{
@@ -27,8 +29,15 @@ namespace AntiAircraftGun
services.AddSingleton()
.AddLogging(option =>
{
+ var configuration = new ConfigurationBuilder()
+ .AddJsonFile("C:\\Σνθβεπρθςες\\2 κσπρ\\ΠΟΟ\\AntiAircraftGun\\AntiAircraftGun\\AntiAircraftGun\\seriLog.json")
+ .Build();
+
+ var Logger = new LoggerConfiguration()
+ .ReadFrom.Configuration(configuration)
+ .CreateLogger();
option.SetMinimumLevel(LogLevel.Information);
- option.AddNLog("nlog.config");
+ option.AddSerilog(Logger);
});
}
}
diff --git a/AntiAircraftGun/AntiAircraftGun/SetAntiAircraftGunsGeneric.cs b/AntiAircraftGun/AntiAircraftGun/SetAntiAircraftGunsGeneric.cs
index 29b3012..b5b0f68 100644
--- a/AntiAircraftGun/AntiAircraftGun/SetAntiAircraftGunsGeneric.cs
+++ b/AntiAircraftGun/AntiAircraftGun/SetAntiAircraftGunsGeneric.cs
@@ -62,7 +62,7 @@ namespace AntiAircraftGun
///
public T Remove(int position)
{
- if (position < 0 || position >= _places.Count) throw new AntiAircraftGunNotFoundException(position); ;
+ if (position >= _places.Count) throw new AntiAircraftGunNotFoundException(position);
if (_places[position] == null) throw new AntiAircraftGunNotFoundException(position);
T removed = _places[position];
_places.RemoveAt(position);
diff --git a/AntiAircraftGun/AntiAircraftGun/nlog.config b/AntiAircraftGun/AntiAircraftGun/nlog.config
deleted file mode 100644
index 6d5e25e..0000000
--- a/AntiAircraftGun/AntiAircraftGun/nlog.config
+++ /dev/null
@@ -1,13 +0,0 @@
-ο»Ώ
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/AntiAircraftGun/AntiAircraftGun/seriLog.json b/AntiAircraftGun/AntiAircraftGun/seriLog.json
new file mode 100644
index 0000000..15f0b39
--- /dev/null
+++ b/AntiAircraftGun/AntiAircraftGun/seriLog.json
@@ -0,0 +1,12 @@
+{
+ "Serilog": {
+ "Using": [ "Serilog.Sinks.File" ],
+ "MinimumLevel": "Debug",
+ "WriteTo": [
+ {
+ "Name": "File",
+ "Args": { "path": "C:\\Π£Π½ΠΈΠ²Π΅ΡΡΠΈΡΠ΅Ρ\\2 ΠΊΡΡΡ\\Π ΠΠ\\AntiAircraftGun\\AntiAircraftGun\\AntiAircraftGun\\bin\\Debug\\net6.0-windows\\Log.txt" }
+ }
+ ]
+ }
+}