<commit_before>﻿using System;
using System.IO;

namespace TestabilityKata
{
    public class Program
    {
        public static void Main(string[] args)
        {
            try
            {
                Logger.Log(LogLevel.Warning, "Some warning - program is starting up or whatever");
                MailSender.SendMail("some-invalid-email-address.com", "Program has started.");
            } 
            catch(Exception ex)
            {
                Logger.Log(LogLevel.Error, "An error occured: " + ex);
            }
        }
    }

    public enum LogLevel
    {
        Warning,
        Error
    }

    public static class Logger
    {
        public static void Log(LogLevel logLevel, string logText)
        {
            Console.WriteLine(logLevel + ": " + logText);

            if (logLevel == LogLevel.Error)
            {

                //also log to file
                var writer = new CustomFileWriter(@"C:\" + logLevel + "-annoying-log-file.txt");
                writer.AppendLine(logText);

                //send e-mail about error
                MailSender.SendMail("<EMAIL>", logText);

            }
        }
    }

    public static class MailSender
    {
        public static void SendMail(string recipient, string content)<commit_msg>updates to messages.<commit_after>﻿using System;
using System.IO;

namespace TestabilityKata
{
    public class Program
    {
        public static void Main(string[] args)
        {
            try
            {
                Logger.Log(LogLevel.Information, "Program is starting up or whatever");
                MailSender.SendMail("some-invalid-email-address.com", "Program has started.");
            } 
            catch(Exception ex)
            {
                Logger.Log(LogLevel.Error, "An error occured: " + ex);
            }
        }
    }

    public enum LogLevel
    {
        Debug,
        Information,
        Warning,
        Error
    }

    public static class Logger
    {
        public static void Log(LogLevel logLevel, string logText)
        {
            Console.WriteLine(logLevel + ": " + logText);

            if (logLevel == LogLevel.Error || logLevel == LogLevel.Warning)
            {

                //also log to file
                var writer = new CustomFileWriter(@"C:\" + logLevel + "-annoying-log-file.txt");
                writer.AppendLine(logText);

                //send e-mail about error
                MailSender.SendMail("<EMAIL>", logText);

            }
        }
    }

    public static class MailSender
    {
        public static void SendMail(string recipient, string content)
{'fraction_non_alphanumeric': 0.09405940594059406, 'fraction_numerical': 0.0, 'mean_word_length': 1.5138755980861245, 'pattern_counts': {'":': 2, '<': 5, '<?xml version=': 0, '>': 5, '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': '902622', 'n_tokens_mistral': 695, 'n_tokens_neox': 657, 'n_words': 171}