Exemple #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;
        }
Exemple #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);
        }
Exemple #3
0
 public void Error(PackingException exception)
 {
     LogCore(exception, "error");
 }
Exemple #4
0
 public void Warning(PackingException exception)
 {
     LogCore(exception, "warning");
 }