using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading;
using ThreadingState = System.Threading.ThreadState;
namespace Framework.Logging
{
public enum LogType
{
Server,
Network,
Debug,
Error,
Warn,
Storage
}
public enum LogNetDir // Network direction
{
C2P, // C>P S
P2S, // C P>S
S2P, // C P LogToColorType = new()
{
{ LogType.Debug, (ConsoleColor.DarkBlue, " Debug ") },
{ LogType.Server, (ConsoleColor.Blue, " Server ") },
{ LogType.Network, (ConsoleColor.Green, " Network ") },
{ LogType.Error, (ConsoleColor.Red, " Error ") },
{ LogType.Warn, (ConsoleColor.Yellow, " Warning ") },
{ LogType.Storage, (ConsoleColor.Cyan, " Storage ") },
};
static BlockingCollection<(LogType Type, string Message)> logQueue = new();
private static Thread? _logOutputThread = null;
public static bool IsLogging => _logOutputThread != null && !logQueue.IsCompleted;
public static bool DebugLogEnabled { get; set; }
/// "C