aboutsummaryrefslogtreecommitdiffstats
path: root/src/slskd/Shares/ShareRepository.cs
diff options
context:
space:
mode:
authorJP Dillingham <jp@dillingham.me>2022-10-01 17:24:34 -0500
committerJP Dillingham <jp@dillingham.me>2022-10-01 17:24:34 -0500
commit65bb516bd6d9d8caa262d5e3d1369f4221ab38dd (patch)
tree92eb88165ef26dbc91540f7ca6f761da1f8598b9 /src/slskd/Shares/ShareRepository.cs
parent36b1e1d4537d817d7a02987a25e5f0cc792d5f8f (diff)
downloadslskd-65bb516bd6d9d8caa262d5e3d1369f4221ab38dd.tar.gz
use correct logger
Diffstat (limited to 'src/slskd/Shares/ShareRepository.cs')
-rw-r--r--src/slskd/Shares/ShareRepository.cs10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/slskd/Shares/ShareRepository.cs b/src/slskd/Shares/ShareRepository.cs
index ba4b714c..b8ecd2be 100644
--- a/src/slskd/Shares/ShareRepository.cs
+++ b/src/slskd/Shares/ShareRepository.cs
@@ -23,6 +23,7 @@ namespace slskd.Shares
using System.Linq;
using Microsoft.Data.Sqlite;
using Serilog;
+ using slskd.Transfers.Uploads;
using Soulseek;
/// <summary>
@@ -142,6 +143,7 @@ namespace slskd.Shares
}
private string ConnectionString { get; }
+ private ILogger Log { get; } = Serilog.Log.ForContext<ShareRepository>();
/// <summary>
/// Attempts to validate the database at the specified <paramref name="connectionString"/>.
@@ -156,6 +158,8 @@ namespace slskd.Shares
throw new ArgumentNullException(nameof(connectionString), "A connection string is required");
}
+ var log = Serilog.Log.ForContext<ShareRepository>();
+
var schema = new Dictionary<string, string>()
{
{ "directories", "CREATE TABLE directories (name TEXT PRIMARY KEY, timestamp INTEGER NOT NULL)" },
@@ -165,7 +169,7 @@ namespace slskd.Shares
try
{
- Log.Debug("Validating shares database with connection string {String}", connectionString);
+ log.Debug("Validating shares database with connection string {String}", connectionString);
using var conn = new SqliteConnection(connectionString);
conn.Open();
@@ -188,7 +192,7 @@ namespace slskd.Shares
}
else
{
- Log.Debug("Shares database table {Table} is valid: {Actual}", table, actualSql);
+ log.Debug("Shares database table {Table} is valid: {Actual}", table, actualSql);
}
}
@@ -204,7 +208,7 @@ namespace slskd.Shares
}
catch (Exception ex)
{
- Log.Debug(ex, $"Failed to validate shares database with connection string {connectionString}: {ex.Message}");
+ log.Debug(ex, $"Failed to validate shares database with connection string {connectionString}: {ex.Message}");
return false;
}
}