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())); }); }
public string[] GetLog() { return(_memoryLog?.FullLog() ?? new string[0]); }