Example #1
0
        public void LogCore(PackingException exception, string type)
        {
            var color = Console.ForegroundColor;

            Console.ForegroundColor = ConsoleColor.Red;

            var builder = new StringBuilder();

            if (!string.IsNullOrWhiteSpace(exception.File))
            {
                builder.Append(exception.File);
            }

            builder.Append(type);

            if (!string.IsNullOrWhiteSpace(exception.Key))
            {
                builder.Append($" {exception.Key}");
            }

            builder.Append(": ");
            builder.Append(exception.Message);

            Console.ForegroundColor = color;
        }
Example #2
0
        public void Warning(PackingException exception)
        {
            var message = exception.Message;

            if (!string.IsNullOrEmpty(exception.Key))
            {
                message = exception.Key + ": " + exception.Message;
            }

            Warning(message, targetFile: exception.File);
        }
Example #3
0
 public void Error(PackingException exception)
 {
     LogCore(exception, "error");
 }
Example #4
0
 public void Warning(PackingException exception)
 {
     LogCore(exception, "warning");
 }