<commit_before>﻿using System;
using System.Globalization;
using System.Web.Mvc;

namespace Jwc.TfsBuilder.WebApplication.Infrastructure
{
    /// <summary>
    /// Defines an attribute to notify an exception message.
    /// </summary>
    [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = false)]
    [CLSCompliant(false)]
    public sealed class NotifyErrorAttribute : FilterAttribute, IExceptionFilter
    {
        private readonly EmailLogger _logger;

        /// <summary>
        /// Initializes a new instance of the <see cref="NotifyErrorAttribute"/> class.
        /// </summary>
        /// <param name="logger">A logger.</param>
        public NotifyErrorAttribute(EmailLogger logger)
        {
            if (logger == null)
            {
                throw new ArgumentNullException("logger");
            }

            _logger = logger;
        }

        /// <summary>
        /// Gets a value indicating the logger.
        /// </summary>
        public EmailLogger Logger
        {
            get
            {
                return _logger;
            }
        }

        /// <inheritdoc/>
        public void OnException(ExceptionContext filterContext)
        {
            if (filterContext == null)
            {
                throw new ArgumentNullException("filterContext");
            }

            Logger.Log(
                subject: string.Format(
                    CultureInfo.CurrentCulture,
                    "TfsBuilder - {0}",
                    filterContext.Exception.GetType().Name),<commit_msg>Changed the type of the Logger property<commit_after>﻿using System;
using System.Globalization;
using System.Web.Mvc;

namespace Jwc.TfsBuilder.WebApplication.Infrastructure
{
    /// <summary>
    /// Defines an attribute to notify an exception message.
    /// </summary>
    [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = false)]
    [CLSCompliant(false)]
    public sealed class NotifyErrorAttribute : FilterAttribute, IExceptionFilter
    {
        private readonly ILogger _logger;

        /// <summary>
        /// Initializes a new instance of the <see cref="NotifyErrorAttribute"/> class.
        /// </summary>
        /// <param name="logger">A logger.</param>
        public NotifyErrorAttribute(EmailLogger logger)
        {
            if (logger == null)
            {
                throw new ArgumentNullException("logger");
            }

            _logger = logger;
        }

        /// <summary>
        /// Gets a value indicating the logger.
        /// </summary>
        public ILogger Logger
        {
            get
            {
                return _logger;
            }
        }

        /// <inheritdoc/>
        public void OnException(ExceptionContext filterContext)
        {
            if (filterContext == null)
            {
                throw new ArgumentNullException("filterContext");
            }

            Logger.Log(
                subject: string.Format(
                    CultureInfo.CurrentCulture,
                    "TfsBuilder - {0}",
                    filterContext.Exception.GetType().Name),
{'fraction_non_alphanumeric': 0.09798994974874371, 'fraction_numerical': 0.000628140703517588, 'mean_word_length': 1.6213991769547325, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 23, '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': '1561109', 'n_tokens_mistral': 765, 'n_tokens_neox': 742, 'n_words': 185}