<commit_before>﻿using System;
using System.Diagnostics;
using PrinterAgent.Service;

namespace PrinterAgent.Util
{
    public class Logger
    {
        private static PrinterConfigurationService confService = new PrinterConfigurationService();

        public static void LogErrorToPrintConf(string message)
        {
            var id = PrintConfiguration.Instance?.Secret ?? RegistryDataResolver.GetStoredPrinterAgentId();
            confService.SendLog(id, ComposeMessage("ERROR", message));
            LogError(message);
        }

        public static void LogError(string message)
        {
            using (EventLog eventLog = new EventLog("Application"))<commit_msg>bugfix<commit_after>﻿using System;
using System.Diagnostics;
using PrinterAgent.Service;

namespace PrinterAgent.Util
{
    public class Logger
    {
        private static PrinterConfigurationService confService = new PrinterConfigurationService();

        public static void LogErrorToPrintConf(string message)
        {
            var id = PrintConfiguration.Instance?.Secret ?? RegistryDataResolver.GetStoredPrinterAgentId();
            try
            {
                confService.SendLog(id, ComposeMessage("ERROR", message));
            }
            catch { }
            LogError(message);
        }

        public static void LogError(string message)
        {
            using (EventLog eventLog = new EventLog("Application"))
{'fraction_non_alphanumeric': 0.07719298245614035, 'fraction_numerical': 0.0, 'mean_word_length': 2.7232375979112273, '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': '6857676', 'n_tokens_mistral': 341, 'n_tokens_neox': 335, 'n_words': 81}