<commit_before>﻿using System;
using SiteWarmer.Core.Config;

namespace SiteWarmer.Core.Logging
{
	public class ConsoleLogger : ILogger
	{
		public void Log(Check check)
		{
			var passed = (check.Passed()) ? "Passed" : "Failed";
			Console.WriteLine(String.Format("{0}: {1} - {2}", check.Status, check.Url, passed));
		}

		public void Close()
		{
			// no need to do anything here
		}
	}
}<commit_msg>Updated ConsoleLogger to represent errors in red<commit_after>﻿using System;
using SiteWarmer.Core.Config;

namespace SiteWarmer.Core.Logging
{
	public class ConsoleLogger : ILogger
	{
		private static ConsoleColor _originalTextColour;
		private const ConsoleColor ErrorTextColour = ConsoleColor.Red;

		public ConsoleLogger()
		{
			_originalTextColour = Console.ForegroundColor;
		}

		public void Log(Check check)
		{
			var passed = (check.Passed()) ? "Passed" : "Failed";


			if (check.Passed())
			{
				WritePass(check, passed);
			}
			else
			{
				WriteFail(check, passed);
			}
		}

		private static void WritePass(Check check, string passed)
		{
			WriteToConsole(check, passed);
		}

		private static void WriteFail(Check check, string passed)
		{
			Console.ForegroundColor = ErrorTextColour;
			WriteToConsole(check, passed);
			Console.ForegroundColor = _originalTextColour;
		}

		private static void WriteToConsole(Check check, string passed)
		{
			Console.WriteLine("{0}: {1} - {2}", check.Status, check.Url, passed);
		}

		public void Close()
		{
			// no need to do anything here
		}
	}
}
{'fraction_non_alphanumeric': 0.11492734478203434, 'fraction_numerical': 0.003963011889035667, 'mean_word_length': 3.7049689440993787, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5894782', 'n_tokens_mistral': 559, 'n_tokens_neox': 485, 'n_words': 123}