<commit_before>﻿/*
   Copyright 2015 <NAME>

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
*/

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;

namespace EnergonSoftware.BackpackPlanner.Core.Logging
{
    /// <summary>
    /// Cross-platform logger interface.
    /// </summary>
    /// <remarks>
    /// Implement this on each platform to enable library logging.
    /// </remarks>
    // TODO: if we make this an abstract class, we can make the Debug()
    // methods Conditional, and thus avoid the #if DEBUG in the code
    public interface ILogger
    {
        /// <summary>
        /// Debug entry.
        /// </summary>
        /// <param name="message">The message.</param>
        void Debug(string message);

        void Debug(string message, Exception ex);

        /// <summary>
        /// Info entry.
        /// </summary>
        /// <param name="message">The message.</param>
        void Info(string message);

        void Info(string message, Exception ex);

        /// <summary>
        /// Warning entry.
        /// </summary>
        /// <param name="message">The message.</param>
        void Warn(string message);

        void Warn(string message, Exception ex);

        /// <summary>
        /// Error entry.
        /// </summary>
        /// <param name="message">The message.</param>
        void Error(string message);

        void Error(string message, Exception ex);
    }

    /// <summary>
    /// log4net-style logger class
    /// </summary>
    public sealed class CustomLogger : ILogger
    {
        private static ILogger _platformLogger = new DiagnosticsLogger();

        /// <summary>
        /// Gets the platform logger.
        /// </summary>
        /// <value>
        /// The platform logger.
        /// </value>
        public static ILogger PlatformLogger
        {
            get { return _platformLogger; }
            set { _platformLogger = value ?? new DiagnosticsLogger(); }
        }

        private const int MaxLogBuffer = 50;

#if DEBUG
        public static event EventHandler<LogMessageEventArgs> LogMessageEvent;
<commit_msg>Increased the log buffer size<commit_after>﻿/*
   Copyright 2015 <NAME>

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
*/

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;

namespace EnergonSoftware.BackpackPlanner.Core.Logging
{
    /// <summary>
    /// Cross-platform logger interface.
    /// </summary>
    /// <remarks>
    /// Implement this on each platform to enable library logging.
    /// </remarks>
    // TODO: if we make this an abstract class, we can make the Debug()
    // methods Conditional, and thus avoid the #if DEBUG in the code
    public interface ILogger
    {
        /// <summary>
        /// Debug entry.
        /// </summary>
        /// <param name="message">The message.</param>
        void Debug(string message);

        void Debug(string message, Exception ex);

        /// <summary>
        /// Info entry.
        /// </summary>
        /// <param name="message">The message.</param>
        void Info(string message);

        void Info(string message, Exception ex);

        /// <summary>
        /// Warning entry.
        /// </summary>
        /// <param name="message">The message.</param>
        void Warn(string message);

        void Warn(string message, Exception ex);

        /// <summary>
        /// Error entry.
        /// </summary>
        /// <param name="message">The message.</param>
        void Error(string message);

        void Error(string message, Exception ex);
    }

    /// <summary>
    /// log4net-style logger class
    /// </summary>
    public sealed class CustomLogger : ILogger
    {
        private static ILogger _platformLogger = new DiagnosticsLogger();

        /// <summary>
        /// Gets the platform logger.
        /// </summary>
        /// <value>
        /// The platform logger.
        /// </value>
        public static ILogger PlatformLogger
        {
            get { return _platformLogger; }
            set { _platformLogger = value ?? new DiagnosticsLogger(); }
        }

#if DEBUG
        private const int MaxLogBuffer = 150;

        public static event EventHandler<LogMessageEventArgs> LogMessageEvent;

{'fraction_non_alphanumeric': 0.11084247721777943, 'fraction_numerical': 0.004277478147665985, 'mean_word_length': 2.081948424068768, 'pattern_counts': {'":': 0, '<': 59, '<?xml version=': 0, '>': 59, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '1786702', 'n_tokens_mistral': 1366, 'n_tokens_neox': 1345, 'n_words': 500}