public static void Log(ActionMessage msg) { new Thread(() => { lock (syncLock) { printLevel(msg.Level); PrintCurrentTime(); PrintCaller(msg); PrintMessage(msg.Message, msg.Level); if (LogToFile) { if (currentFileName.Equals(string.Empty)) { currentFileName = RELATIVE_LOG_PATH + GetCurrentDateTimeFormated() + ".log"; } WriteFile(currentFileName, true, GetLogString(msg) + Environment.NewLine); } } }).Start(); }
private static string GetSourceString(ActionMessage msg) { return(msg.Source + " => "); }
private static void PrintCaller(ActionMessage msg) { Console.ForegroundColor = ConsoleColor.Cyan; Console.Write(GetSourceString(msg)); }