mirror of
https://github.com/TeamOctolings/Octobot.git
synced 2025-04-20 00:43:36 +03:00
Logger fixes
Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com>
This commit is contained in:
parent
4d2a1577d7
commit
94aba8e17c
4 changed files with 5 additions and 5 deletions
|
@ -23,14 +23,14 @@ public class ErrorLoggingPostExecutionEvent : IPostExecutionEvent
|
||||||
/// Logs a warning using the injected <see cref="ILogger" /> if the <paramref name="commandResult" /> has not
|
/// Logs a warning using the injected <see cref="ILogger" /> if the <paramref name="commandResult" /> has not
|
||||||
/// succeeded.
|
/// succeeded.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="context">The context of the slash command. Unused.</param>
|
/// <param name="context">The context of the slash command.</param>
|
||||||
/// <param name="commandResult">The result whose success is checked.</param>
|
/// <param name="commandResult">The result whose success is checked.</param>
|
||||||
/// <param name="ct">The cancellation token for this operation. Unused.</param>
|
/// <param name="ct">The cancellation token for this operation. Unused.</param>
|
||||||
/// <returns>A result which has succeeded.</returns>
|
/// <returns>A result which has succeeded.</returns>
|
||||||
public Task<Result> AfterExecutionAsync(
|
public Task<Result> AfterExecutionAsync(
|
||||||
ICommandContext context, IResult commandResult, CancellationToken ct = default)
|
ICommandContext context, IResult commandResult, CancellationToken ct = default)
|
||||||
{
|
{
|
||||||
_logger.LogResult(commandResult, "Error in slash command execution.");
|
_logger.LogResult(commandResult, $"Error in slash command execution for /{context.Command.Command.Node.Key}.");
|
||||||
|
|
||||||
return Task.FromResult(Result.FromSuccess());
|
return Task.FromResult(Result.FromSuccess());
|
||||||
}
|
}
|
||||||
|
|
|
@ -280,7 +280,7 @@ public static class Extensions
|
||||||
|
|
||||||
if (result.Error is ExceptionError exe)
|
if (result.Error is ExceptionError exe)
|
||||||
{
|
{
|
||||||
logger.LogError(exe.Exception, "{UserMessage}\n{ResultErrorMessage}", message, result.Error.Message);
|
logger.LogError(exe.Exception, "{ErrorMessage}", message);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -50,7 +50,7 @@ public sealed partial class MemberUpdateService : BackgroundService
|
||||||
tasks.AddRange(guildIds.Select(async id =>
|
tasks.AddRange(guildIds.Select(async id =>
|
||||||
{
|
{
|
||||||
var tickResult = await TickMemberDatasAsync(id, ct);
|
var tickResult = await TickMemberDatasAsync(id, ct);
|
||||||
_logger.LogResult(tickResult);
|
_logger.LogResult(tickResult, $"Error in member data update for guild {id}.");
|
||||||
}));
|
}));
|
||||||
|
|
||||||
await Task.WhenAll(tasks);
|
await Task.WhenAll(tasks);
|
||||||
|
|
|
@ -46,7 +46,7 @@ public sealed class ScheduledEventUpdateService : BackgroundService
|
||||||
tasks.AddRange(guildIds.Select(async id =>
|
tasks.AddRange(guildIds.Select(async id =>
|
||||||
{
|
{
|
||||||
var tickResult = await TickScheduledEventsAsync(id, ct);
|
var tickResult = await TickScheduledEventsAsync(id, ct);
|
||||||
_logger.LogResult(tickResult);
|
_logger.LogResult(tickResult, $"Error in scheduled events update for guild {id}.");
|
||||||
}));
|
}));
|
||||||
|
|
||||||
await Task.WhenAll(tasks);
|
await Task.WhenAll(tasks);
|
||||||
|
|
Loading…
Add table
Reference in a new issue