<commit_before>﻿// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using System;
using System.Globalization;
using System.Text;
using Microsoft.Framework.Logging;

namespace Microsoft.AspNet.DataProtection
{
    internal sealed class StringLoggerFactory : ILoggerFactory
    {
        private readonly StringBuilder _log = new StringBuilder();

        public StringLoggerFactory(LogLevel logLevel)
        {
            MinimumLevel = logLevel;
        }

        public LogLevel MinimumLevel { get; set; }

        public void AddProvider(ILoggerProvider provider)
        {
            // no-op
        }

        public ILogger CreateLogger(string name)
        {
            return new StringLogger(name, this);
        }

        public override string ToString()
        {
            return _log.ToString();
        }

        private sealed class StringLogger : ILogger
        {
            private readonly StringLoggerFactory _factory;
            private readonly string _name;

            public StringLogger(string name, StringLoggerFactory factory)
            {
                _name = name;
                _factory = factory;
            }

            public IDisposable BeginScope(object state)
            {
                return new DummyDisposable();
            }

            public bool IsEnabled(LogLevel logLevel)
            {
                return (logLevel >= _factory.MinimumLevel);<commit_msg>Reacting to ILogger api changes<commit_after>﻿// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using System;
using System.Globalization;
using System.Text;
using Microsoft.Framework.Logging;

namespace Microsoft.AspNet.DataProtection
{
    internal sealed class StringLoggerFactory : ILoggerFactory
    {
        private readonly StringBuilder _log = new StringBuilder();

        public StringLoggerFactory(LogLevel logLevel)
        {
            MinimumLevel = logLevel;
        }

        public LogLevel MinimumLevel { get; set; }

        public void AddProvider(ILoggerProvider provider)
        {
            // no-op
        }

        public ILogger CreateLogger(string name)
        {
            return new StringLogger(name, this);
        }

        public override string ToString()
        {
            return _log.ToString();
        }

        private sealed class StringLogger : ILogger
        {
            private readonly StringLoggerFactory _factory;
            private readonly string _name;

            public StringLogger(string name, StringLoggerFactory factory)
            {
                _name = name;
                _factory = factory;
            }

            public IDisposable BeginScopeImpl(object state)
            {
                return new DummyDisposable();
            }

            public bool IsEnabled(LogLevel logLevel)
            {
                return (logLevel >= _factory.MinimumLevel);
{'fraction_non_alphanumeric': 0.061587301587301586, 'fraction_numerical': 0.0012698412698412698, 'mean_word_length': 1.9148936170212767, 'pattern_counts': {'":': 0, '<': 3, '<?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': '4823398', 'n_tokens_mistral': 744, 'n_tokens_neox': 712, 'n_words': 227}