mirror of
https://github.com/RPCS3/discord-bot.git
synced 2026-01-31 01:25:22 +01:00
do not spam pipe debug logs in release configuration
This commit is contained in:
@@ -124,7 +124,6 @@ internal static class MessageMenuCommands
|
||||
return;
|
||||
}
|
||||
await ctx.RespondAsync($"{Config.Reactions.Success} Message was enqueued for analysis", ephemeral: true).ConfigureAwait(false);
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -22,7 +22,9 @@ internal static partial class LogParser
|
||||
{
|
||||
result = await reader.ReadAsync(cancellationToken).ConfigureAwait(false);
|
||||
var buffer = result.Buffer;
|
||||
#if DEBUG
|
||||
Config.Log.Debug($"{nameof(LogParser)}: Read {buffer.Length} bytes from reader");
|
||||
#endif
|
||||
if (!skippedBom)
|
||||
{
|
||||
if (buffer.Length < 3)
|
||||
@@ -32,7 +34,9 @@ internal static partial class LogParser
|
||||
if (potentialBom.ToArray().SequenceEqual(Bom))
|
||||
{
|
||||
reader.AdvanceTo(potentialBom.End);
|
||||
#if DEBUG
|
||||
Config.Log.Debug($"{nameof(LogParser)}: Reader advanced to {potentialBom.End} to skip BOM");
|
||||
#endif
|
||||
totalReadBytes += potentialBom.Length;
|
||||
skippedBom = true;
|
||||
continue;
|
||||
@@ -52,7 +56,9 @@ internal static partial class LogParser
|
||||
if (state.Error != LogParseState.ErrorCode.None)
|
||||
{
|
||||
await reader.CompleteAsync();
|
||||
#if DEBUG
|
||||
Config.Log.Debug($"{nameof(LogParser)}: Reader completed (error: {state.Error})");
|
||||
#endif
|
||||
return state;
|
||||
}
|
||||
|
||||
@@ -73,7 +79,9 @@ internal static partial class LogParser
|
||||
var sectionStart = currentSectionLines.First is {} firstLine ? firstLine.Value : buffer;
|
||||
totalReadBytes += result.Buffer.Slice(0, sectionStart.Start).Length;
|
||||
reader.AdvanceTo(sectionStart.Start);
|
||||
#if DEBUG
|
||||
Config.Log.Debug($"{nameof(LogParser)}: Reader advanced to {sectionStart.Start} (section start)");
|
||||
#endif
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
@@ -86,7 +94,9 @@ internal static partial class LogParser
|
||||
await TaskScheduler.WaitForClearTagAsync(state).ConfigureAwait(false);
|
||||
state.ReadBytes = totalReadBytes;
|
||||
await reader.CompleteAsync();
|
||||
#if DEBUG
|
||||
Config.Log.Debug($"{nameof(LogParser)}: Reader completed");
|
||||
#endif
|
||||
return state;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user