Remove NullLoggerFactory workaround from the sample.

This commit is contained in:
Chris Ross 2014-05-07 11:35:42 -07:00
parent 08929a6e99
commit b1acd99197
2 changed files with 1 additions and 27 deletions

View File

@ -7,7 +7,6 @@ using Microsoft.AspNet.RequestContainer;
using Microsoft.AspNet.Builder;
using Microsoft.Framework.DependencyInjection;
using Microsoft.Framework.DependencyInjection.Fallback;
using Microsoft.Framework.Logging;
namespace CookieSample
{
@ -15,12 +14,6 @@ namespace CookieSample
{
public void Configuration(IBuilder app)
{
app.UseServices(services =>
{
// TODO: Move to host.
services.AddInstance<ILoggerFactory>(new NullLoggerFactory());
});
app.UseCookieAuthentication(new CookieAuthenticationOptions()
{
@ -41,23 +34,5 @@ namespace CookieSample
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;
}
}
}
}

View File

@ -10,8 +10,7 @@
"Microsoft.AspNet.FeatureModel": "0.1-alpha-*",
"Microsoft.AspNet.HttpFeature": "0.1-alpha-*",
"Microsoft.AspNet.Server.WebListener": "0.1-alpha-*",
"Microsoft.Framework.DependencyInjection": "0.1-alpha-*",
"Microsoft.Framework.Logging": "0.1-alpha-*"
"Microsoft.Framework.DependencyInjection": "0.1-alpha-*"
},
"commands": { "web": "Microsoft.AspNet.Hosting server.name=Microsoft.AspNet.Server.WebListener server.urls=http://localhost:12345" },
"configurations": {