<commit_before>﻿using System.Diagnostics;

#if  NETSTANDARD1_3
using System.Reflection;
#endif

namespace Dccelerator {

    static class Log {
#if NETSTANDARD1_3
        static readonly TraceSource _trace = new TraceSource(typeof(Log).GetTypeInfo().Assembly.GetName().Name);
#else
        static readonly TraceSource _trace = new TraceSource(typeof(Log).Assembly.GetName().Name);
#endif

        internal static void TraceEvent(TraceEventType eventType, string message) {
            _trace.TraceEvent(eventType, 0, message);
        }
    }

}<commit_msg>TraceSource не будет работать если не сконфигурены лисенеры, то есть часть логов на уровне Dccelerator теряются<commit_after>﻿using System.Diagnostics;

#if  NETSTANDARD1_3
using System.Reflection;
#endif

namespace Dccelerator {

    static class Log {
#if NETSTANDARD1_3
        static readonly TraceSource _trace = new TraceSource(typeof(Log).GetTypeInfo().Assembly.GetName().Name);
#else
        static readonly TraceSource _trace = new TraceSource(typeof(Log).Assembly.GetName().Name);
#endif


        internal static void TraceEvent(TraceEventType eventType, string message) {
            _trace.Switch = new SourceSwitch(nameof(Log)) {
                Level = SourceLevels.All
            };
            _trace.Listeners.Remove("Default");
            _trace.Listeners.Add(new TextWriterTraceListener("test.txt") {
                Filter = new EventTypeFilter(SourceLevels.All)
            });

            _trace.TraceEvent(eventType, 0, message);
        }
    }

}
{'fraction_non_alphanumeric': 0.09203655352480418, 'fraction_numerical': 0.006527415143603133, 'mean_word_length': 3.234806629834254, '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': '102746', 'n_tokens_mistral': 445, 'n_tokens_neox': 440, 'n_words': 102}