Remove NullLoggerFactory workaround from the sample.
This commit is contained in:
parent
08929a6e99
commit
b1acd99197
|
|
@ -7,7 +7,6 @@ using Microsoft.AspNet.RequestContainer;
|
||||||
using Microsoft.AspNet.Builder;
|
using Microsoft.AspNet.Builder;
|
||||||
using Microsoft.Framework.DependencyInjection;
|
using Microsoft.Framework.DependencyInjection;
|
||||||
using Microsoft.Framework.DependencyInjection.Fallback;
|
using Microsoft.Framework.DependencyInjection.Fallback;
|
||||||
using Microsoft.Framework.Logging;
|
|
||||||
|
|
||||||
namespace CookieSample
|
namespace CookieSample
|
||||||
{
|
{
|
||||||
|
|
@ -15,12 +14,6 @@ namespace CookieSample
|
||||||
{
|
{
|
||||||
public void Configuration(IBuilder app)
|
public void Configuration(IBuilder app)
|
||||||
{
|
{
|
||||||
app.UseServices(services =>
|
|
||||||
{
|
|
||||||
// TODO: Move to host.
|
|
||||||
services.AddInstance<ILoggerFactory>(new NullLoggerFactory());
|
|
||||||
});
|
|
||||||
|
|
||||||
app.UseCookieAuthentication(new CookieAuthenticationOptions()
|
app.UseCookieAuthentication(new CookieAuthenticationOptions()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
@ -41,23 +34,5 @@ namespace CookieSample
|
||||||
await context.Response.WriteAsync("Hello old timer");
|
await context.Response.WriteAsync("Hello old timer");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Temp workaround until the host reliably provides logging.
|
|
||||||
// If ILoggerFactory is never guaranteed, move this fallback into Microsoft.Framework.Logging.
|
|
||||||
private class NullLoggerFactory : ILoggerFactory
|
|
||||||
{
|
|
||||||
public ILogger Create(string name)
|
|
||||||
{
|
|
||||||
return new NullLongger();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private class NullLongger : ILogger
|
|
||||||
{
|
|
||||||
public bool WriteCore(TraceType eventType, int eventId, object state, Exception exception, Func<object, Exception, string> formatter)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -10,8 +10,7 @@
|
||||||
"Microsoft.AspNet.FeatureModel": "0.1-alpha-*",
|
"Microsoft.AspNet.FeatureModel": "0.1-alpha-*",
|
||||||
"Microsoft.AspNet.HttpFeature": "0.1-alpha-*",
|
"Microsoft.AspNet.HttpFeature": "0.1-alpha-*",
|
||||||
"Microsoft.AspNet.Server.WebListener": "0.1-alpha-*",
|
"Microsoft.AspNet.Server.WebListener": "0.1-alpha-*",
|
||||||
"Microsoft.Framework.DependencyInjection": "0.1-alpha-*",
|
"Microsoft.Framework.DependencyInjection": "0.1-alpha-*"
|
||||||
"Microsoft.Framework.Logging": "0.1-alpha-*"
|
|
||||||
},
|
},
|
||||||
"commands": { "web": "Microsoft.AspNet.Hosting server.name=Microsoft.AspNet.Server.WebListener server.urls=http://localhost:12345" },
|
"commands": { "web": "Microsoft.AspNet.Hosting server.name=Microsoft.AspNet.Server.WebListener server.urls=http://localhost:12345" },
|
||||||
"configurations": {
|
"configurations": {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue