Пример #1
0
        private void LogMessage(
            ConsoleColor? color,
            string token,
            string message)
        {
            try
            {
                if (color.HasValue)
                {
                    Console.ForegroundColor = color.GetValueOrDefault();
                }

                Console.WriteLine(string.Concat(
                    "[", token, "] ",
                    message));
            }
            finally
            {
                Console.ResetColor();
            }
        }