Example #1
0
 public void ConsoleWriteLine(LogType logTypeName, dynamic logSubtype, string message)
 {
     if ((byte)logSubtype > ConsoleLogLevel)
     {
         return;
     }
     lock (IOLocker)
     {
         if (!ConsoleColors.GetColor(logTypeName, (byte)logSubtype, out var pColor))
         {
             return;
         }
         Console.ForegroundColor = pColor;
         Console.WriteLine("\r" + message);
         Console.ResetColor();
     }
 }
Example #2
0
        public void ConsoleWriteLine(LogType logTypeName, dynamic logSubtype, string message, params object[] args)
        {
            if ((byte)logSubtype > ConsoleLogLevel)
            {
                return;
            }
            lock (IOLocker)
            {
                if (!ConsoleColors.GetColor(logTypeName, (byte)logSubtype, out var pColor))
                {
                    return;
                }
                var msg = string.Format($"[{logTypeName}][{logSubtype}] {string.Format(message, args)}");

                Console.ForegroundColor = pColor;
                Console.WriteLine(msg);
                Console.ResetColor();
            }
        }