added basic logging
This commit is contained in:
parent
a9a59eb433
commit
9686d6187d
3 changed files with 33 additions and 5 deletions
|
@ -1,4 +1,5 @@
|
||||||
using System.Collections.Generic;
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
@ -212,9 +213,19 @@ namespace BSLManager
|
||||||
{
|
{
|
||||||
Application.MainLoop.Invoke(async () =>
|
Application.MainLoop.Invoke(async () =>
|
||||||
{
|
{
|
||||||
var userToDelete = _state.GetElementAt(el);
|
try
|
||||||
await _removeFollowerAction.ProcessAsync(userToDelete);
|
{
|
||||||
_state.RemoveAt(el);
|
var userToDelete = _state.GetElementAt(el);
|
||||||
|
|
||||||
|
BasicLogger.Log($"Delete {userToDelete.Acct}@{userToDelete.Host}");
|
||||||
|
await _removeFollowerAction.ProcessAsync(userToDelete);
|
||||||
|
BasicLogger.Log($"Remove user from list");
|
||||||
|
_state.RemoveAt(el);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
BasicLogger.Log(e.Message);
|
||||||
|
}
|
||||||
|
|
||||||
ConsoleGui.RefreshUI();
|
ConsoleGui.RefreshUI();
|
||||||
});
|
});
|
||||||
|
|
13
src/BSLManager/Tools/BasicLogger.cs
Normal file
13
src/BSLManager/Tools/BasicLogger.cs
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
using System;
|
||||||
|
using System.IO;
|
||||||
|
|
||||||
|
namespace BSLManager.Tools
|
||||||
|
{
|
||||||
|
public static class BasicLogger
|
||||||
|
{
|
||||||
|
public static void Log(string log)
|
||||||
|
{
|
||||||
|
File.AppendAllLines($"Log-{Guid.NewGuid()}.txt", new []{ log });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,4 +1,5 @@
|
||||||
using System.Threading.Tasks;
|
using System;
|
||||||
|
using System.Threading.Tasks;
|
||||||
using BirdsiteLive.DAL.Contracts;
|
using BirdsiteLive.DAL.Contracts;
|
||||||
using BirdsiteLive.Domain.Repository;
|
using BirdsiteLive.Domain.Repository;
|
||||||
using BirdsiteLive.Moderation.Actions;
|
using BirdsiteLive.Moderation.Actions;
|
||||||
|
@ -38,7 +39,10 @@ namespace BirdsiteLive.Moderation.Processors
|
||||||
|
|
||||||
if (type == ModerationTypeEnum.WhiteListing && status != ModeratedTypeEnum.WhiteListed ||
|
if (type == ModerationTypeEnum.WhiteListing && status != ModeratedTypeEnum.WhiteListed ||
|
||||||
type == ModerationTypeEnum.BlackListing && status == ModeratedTypeEnum.BlackListed)
|
type == ModerationTypeEnum.BlackListing && status == ModeratedTypeEnum.BlackListed)
|
||||||
|
{
|
||||||
|
Console.WriteLine($"Remove {followerHandle}");
|
||||||
await _removeFollowerAction.ProcessAsync(follower);
|
await _removeFollowerAction.ProcessAsync(follower);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue