Skip to content

Commit

Permalink
Cap the in-memory logger at 200MB
Browse files Browse the repository at this point in the history
  • Loading branch information
Erisa committed Sep 4, 2024
1 parent 279a200 commit 114ac45
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ class Program : BaseCommandModule
public static Random rand = new();
public static HasteBinClient hasteUploader;

public static StringWriter outputCapture = new();
public static StringBuilder outputStringBuilder = new(16, 200000000);
public static StringWriter outputCapture;

static public readonly HttpClient httpClient = new();

Expand All @@ -75,6 +76,7 @@ public static void UpdateLists()
static async Task Main(string[] _)
{
Console.OutputEncoding = Encoding.UTF8;
outputCapture = new(outputStringBuilder);

httpClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
var logFormat = "[{Timestamp:yyyy-MM-dd HH:mm:ss zzz}] [{Level}] {Message}{NewLine}{Exception}";
Expand Down

0 comments on commit 114ac45

Please sign in to comment.