<commit_before>﻿using System;
using System.Diagnostics;
using System.Linq;
using System.Threading;
using SystemWrapper.IO;
using Microsoft.Extensions.Logging;
using Nito.AsyncEx.Synchronous;
using NLog.Config;
using NLog.Extensions.Logging;
using NLog.Targets;

namespace Dhgms.CloneAllRepos.Cmd
{
    internal static class Program
    {
        public static int Main(string[] args)
        {
            using (var loggerFactory = new LoggerFactory())
            {
                ConfigureLogging(loggerFactory);

                // todo : update to dotnetcore and use an async main
                var consoleAppJob = new ConsoleAppJob(loggerFactory);
                return consoleAppJob.Handle(args).Result;
            }
        }

        private static void ConfigureLogging(ILoggerFactory loggerFactory)
        {
            loggerFactory.AddNLog(new NLogProviderOptions { CaptureMessageTemplates = true, CaptureMessageProperties =true });
            var config = new LoggingConfiguration();
            var consoleTarget = new ColoredConsoleTarget();
            config.AddTarget("console", consoleTarget);
            var fileTarget = new FileTarget();
            config.AddTarget("file", fileTarget);

            consoleTarget.Layout = @"${date:format=HH\:mm\:ss} ${logger} ${message}";
            var localAppDataPath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);

            fileTarget.FileName = $"{localAppDataPath}/dhgms solutions/cloneallrepos.cmd/nlogfile.txt";
            fileTarget.Layout = "${message}";

            var consoleLogLevel = Debugger.IsAttached ? NLog.LogLevel.Debug : NLog.LogLevel.Info;
            var rule1 = new LoggingRule("*", consoleLogLevel, consoleTarget);<commit_msg>added more detail to file logger<commit_after>﻿using System;
using System.Diagnostics;
using System.Linq;
using System.Threading;
using SystemWrapper.IO;
using Microsoft.Extensions.Logging;
using Nito.AsyncEx.Synchronous;
using NLog.Config;
using NLog.Extensions.Logging;
using NLog.Targets;

namespace Dhgms.CloneAllRepos.Cmd
{
    internal static class Program
    {
        public static int Main(string[] args)
        {
            using (var loggerFactory = new LoggerFactory())
            {
                ConfigureLogging(loggerFactory);

                // todo : update to dotnetcore and use an async main
                var consoleAppJob = new ConsoleAppJob(loggerFactory);
                return consoleAppJob.Handle(args).Result;
            }
        }

        private static void ConfigureLogging(ILoggerFactory loggerFactory)
        {
            loggerFactory.AddNLog(new NLogProviderOptions { CaptureMessageTemplates = true, CaptureMessageProperties =true });
            var config = new LoggingConfiguration();
            var consoleTarget = new ColoredConsoleTarget();
            config.AddTarget("console", consoleTarget);
            var fileTarget = new FileTarget();
            config.AddTarget("file", fileTarget);

            const string defaultLayout = @"${date:format=HH\:mm\:ss} ${logger} ${message}";
            consoleTarget.Layout = defaultLayout;
            var localAppDataPath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);

            fileTarget.FileName = $"{localAppDataPath}/dhgms solutions/cloneallrepos.cmd/nlogfile.txt";
            fileTarget.Layout = defaultLayout;

            var consoleLogLevel = Debugger.IsAttached ? NLog.LogLevel.Debug : NLog.LogLevel.Info;
            var rule1 = new LoggingRule("*", consoleLogLevel, consoleTarget);
{'fraction_non_alphanumeric': 0.09012276785714286, 'fraction_numerical': 0.0005580357142857143, 'mean_word_length': 2.7776606954689145, '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': '3090679', 'n_tokens_mistral': 929, 'n_tokens_neox': 912, 'n_words': 212}