/// <summary> /// Request Log /// </summary> /// <param name="apiName"></param> /// <param name="preColor"></param> /// <param name="status"></param> /// <param name="setColor"></param> public static void ShowRequestResult(string apiName, ConTextColor preColor, int status, ConTextColor setColor) { Console.Write(CheckRequestTime() + $"{apiName} responded "); WrapAPI.SetConsoleTextColor(preColor); Console.WriteLine(status); WrapAPI.SetConsoleTextColor(setColor); }
public static void SetConsoleTextColor(ConTextColor color) { IntPtr handle = GetStdHandle(STD_OUTPUT_HANDLE); SetConsoleTextAttribute(handle, (short)color); }