* some groups stuff * further groups rework * fixes for pause changes * adjsut timeout interval * fixes and namespace change to file scoped * more fixes * further implement groups * fix change group ownership * add some more stuff for groups * more fixes and additions * some fixes based on analyzers, add shard info to ui * add discord command, cleanup * fix regex * add group migration and deletion on user deletion * add api method for client to check health of connection * adjust regex for vanity * fixes for server and bot * fixes some string comparison in linq queries * fixes group leave and sets alias to null * fix syntax in changeownership * add better logging, fixes for group leaving * fixes for group leave Co-authored-by: Stanley Dimant <root.darkarchon@outlook.com>
29 lines
918 B
C#
29 lines
918 B
C#
using MareSynchronosServer.Hubs;
|
|
using Microsoft.Extensions.Logging;
|
|
|
|
namespace MareSynchronosServer.Utils;
|
|
|
|
public class MareHubLogger
|
|
{
|
|
private readonly MareHub _hub;
|
|
private readonly ILogger<MareHub> _logger;
|
|
|
|
public MareHubLogger(MareHub hub, ILogger<MareHub> logger)
|
|
{
|
|
_hub = hub;
|
|
_logger = logger;
|
|
}
|
|
|
|
public void LogCallInfo(string methodName, params object[] args)
|
|
{
|
|
string formattedArgs = args.Length != 0 ? "|" + string.Join(":", args) : string.Empty;
|
|
_logger.LogInformation("{uid}:{method}{args}", _hub.AuthenticatedUserId, methodName, formattedArgs);
|
|
}
|
|
|
|
public void LogCallWarning(string methodName, params object[] args)
|
|
{
|
|
string formattedArgs = args.Length != 0 ? "|" + string.Join(":", args) : string.Empty;
|
|
_logger.LogWarning("{uid}:{method}{args}", _hub.AuthenticatedUserId, methodName, formattedArgs);
|
|
}
|
|
}
|