Exemplo n.º 1
0
        public void Configure(IApplicationBuilder app, IApplicationLifetime applicationLifetime, IHostingEnvironment env, IMemoryLog log)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }

            var noobHost = new NoobotHost(new DotnetCoreConfigReader(Configuration.GetSection("Bot")));

            applicationLifetime.ApplicationStarted.Register(() => noobHost.Start(log));
            applicationLifetime.ApplicationStopping.Register(noobHost.Stop);

            app.Run(async context =>
            {
                await context.Response.WriteAsync(string.Join(Environment.NewLine, log.FullLog()));
            });
        }
Exemplo n.º 2
0
 public string[] GetLog()
 {
     return(_memoryLog?.FullLog() ?? new string[0]);
 }