private static void ExecInternal(PackOptions opts)
        {
            IServiceCollection serviceCollection = new ServiceCollection();

            ConfigureServices(serviceCollection, opts);
            var application = new Application(serviceCollection.BuildServiceProvider());

            Environment.ExitCode = application.Run();
        }
        private static void ConfigureServices(IServiceCollection serviceCollection, PackOptions packOptions)
        {
            serviceCollection.AddLogging(config =>
            {
#if DEBUG
                config.AddDebug();
#endif
                config.AddConsole();
            })
            .Configure <LoggerFilterOptions>(options =>
            {
#if DEBUG
                options.AddFilter <DebugLoggerProvider>(null, LogLevel.Trace);
#endif
                options.AddFilter <ConsoleLoggerProvider>(null, LogLevel.Information);
            });
            var lsp = serviceCollection.BuildServiceProvider();
            serviceCollection.AddTransient <IPacker, Packer>(s => new Packer(packOptions, lsp.GetService <ILoggerFactory>().CreateLogger <IPacker>()));
        }
 public Packer(PackOptions options, ILogger?logger = null)
 {
     _logger = logger;
     Options = options ?? throw new ArgumentNullException(nameof(options));
     MegFile = new MegaFile();
 }