Пример #1
0
        private static bool LogFilter(string category, LogLevel level, IMsilDecompilerEnvironment environment)
        {
            if (environment.LogLevel > level)
            {
                return(false);
            }

            if (!category.StartsWith("ILSpy.Host", StringComparison.OrdinalIgnoreCase))
            {
                return(false);
            }

            return(true);
        }
Пример #2
0
        public Startup(IMsilDecompilerEnvironment env)
        {
            _env = env;

            Log.Logger = new LoggerConfiguration()
                         .MinimumLevel.Debug()
                         .Enrich.FromLogContext()
                         .WriteTo.ColoredConsole()
                         .CreateLogger();

            var builder = new ConfigurationBuilder()
                          .SetBasePath(AppContext.BaseDirectory)
                          .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true)
                          .AddEnvironmentVariables("ILSPYHOST_");

            Configuration = builder.Build();
        }
Пример #3
0
 public SimpleDecompilationProvider(IMsilDecompilerEnvironment decompilationConfiguration, ILoggerFactory loggerFactory)
 {
     _logger = loggerFactory.CreateLogger <SimpleDecompilationProvider>();
 }