Beispiel #1
0
        public static void Log(LogLevel lv, int indentLv, params string[] msgs)
        {
            Console.ForegroundColor = lv.GetColor();
            string indent = "";

            for (int i = 0; i < indentLv; i++)
            {
                indent += "\t";
            }

            Console.WriteLine($"{indent}[{lv.GetSymbol()}] {msgs[0]} [@Line:{CurrentLine}]");

            for (int i = 1; i < msgs.Length; i++)
            {
                Console.WriteLine($"{indent}\t+ {msgs[i]}");
            }

            if (msgs.Length > 1)
            {
                Console.WriteLine($"");
            }

            if (lv.HasFlag(LogLevel.EXIT) || lv.HasFlag(ExitLevel))
            {
                Console.ForegroundColor = ConsoleColor.White;
                Console.WriteLine("Press any key to exit.");
                Console.ReadKey();
                Environment.Exit(1);
            }
        }