mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2026-01-16 08:25:28 +00:00
add logging of invites (#2005)
* add logging of invites * required changes * revert not needed changes * remove not needed convertation
This commit is contained in:
@@ -26,6 +26,7 @@ using System.Threading.Tasks;
|
||||
using ArchiSteamFarm.Localization;
|
||||
using JetBrains.Annotations;
|
||||
using NLog;
|
||||
using SteamKit2;
|
||||
|
||||
namespace ArchiSteamFarm.NLog {
|
||||
public sealed class ArchiLogger {
|
||||
@@ -151,6 +152,20 @@ namespace ArchiSteamFarm.NLog {
|
||||
Logger.Log(logEventInfo);
|
||||
}
|
||||
|
||||
internal void LogInvite(SteamID steamID, [CallerMemberName] string? previousMethodName = null) {
|
||||
if ((steamID.AccountType == EAccountType.Invalid) || (steamID == 0)) {
|
||||
throw new ArgumentNullException(nameof(steamID) + " || " + nameof(steamID.AccountType));
|
||||
}
|
||||
|
||||
string loggedMessage = previousMethodName + "() " + steamID.AccountType + " " + steamID.ConvertToUInt64().ToString();
|
||||
|
||||
LogEventInfo logEventInfo = new LogEventInfo(LogLevel.Trace, Logger.Name, loggedMessage);
|
||||
logEventInfo.Properties["SteamID"] = steamID.ConvertToUInt64();
|
||||
logEventInfo.Properties["AccountType"] = steamID.AccountType;
|
||||
|
||||
Logger.Log(logEventInfo);
|
||||
}
|
||||
|
||||
internal async Task LogFatalException(Exception exception, [CallerMemberName] string? previousMethodName = null) {
|
||||
if (exception == null) {
|
||||
throw new ArgumentNullException(nameof(exception));
|
||||
|
||||
Reference in New Issue
Block a user