mirror of
https://github.com/ultrasn0w/app.git
synced 2025-12-13 10:29:53 +01:00
26 lines
607 B
C#
26 lines
607 B
C#
using System.Text;
|
|
|
|
namespace APP.Utility;
|
|
|
|
internal static class LogBoy
|
|
{
|
|
private static readonly StringBuilder Log = new();
|
|
|
|
internal static async Task LogResponse(HttpResponseMessage message)
|
|
{
|
|
AddToLog(message.RequestMessage?.RequestUri + " " + message.StatusCode + " " + await message.Content.ReadAsStringAsync());
|
|
}
|
|
|
|
internal static void AddToLog(string text)
|
|
{
|
|
Log.Append('[' + DateTime.Now.ToShortTimeString() + "] ");
|
|
Log.Append(text);
|
|
Log.AppendLine();
|
|
}
|
|
|
|
internal static string GetLog()
|
|
{
|
|
return Log.ToString();
|
|
}
|
|
}
|