Removing Null* using Testing Null* classes
This commit is contained in:
parent
16f1ebe6a8
commit
ca32af61a7
|
|
@ -1,17 +0,0 @@
|
||||||
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.
|
|
||||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
|
||||||
|
|
||||||
using System;
|
|
||||||
|
|
||||||
namespace Microsoft.AspNet.Routing
|
|
||||||
{
|
|
||||||
public class NullDisposable : IDisposable
|
|
||||||
{
|
|
||||||
public static NullDisposable Instance = new NullDisposable();
|
|
||||||
|
|
||||||
public void Dispose()
|
|
||||||
{
|
|
||||||
// intentionally does nothing
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,27 +0,0 @@
|
||||||
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.
|
|
||||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
|
||||||
|
|
||||||
using System;
|
|
||||||
using Microsoft.Framework.Logging;
|
|
||||||
|
|
||||||
namespace Microsoft.AspNet.Routing
|
|
||||||
{
|
|
||||||
public class NullLogger : ILogger
|
|
||||||
{
|
|
||||||
public static NullLogger Instance = new NullLogger();
|
|
||||||
|
|
||||||
public IDisposable BeginScope(object state)
|
|
||||||
{
|
|
||||||
return NullDisposable.Instance;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Log(LogLevel logLevel, int eventId, object state, Exception exception, Func<object, Exception, string> formatter)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool IsEnabled(LogLevel logLevel)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,23 +0,0 @@
|
||||||
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.
|
|
||||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
|
||||||
|
|
||||||
using Microsoft.Framework.Logging;
|
|
||||||
|
|
||||||
namespace Microsoft.AspNet.Routing
|
|
||||||
{
|
|
||||||
public class NullLoggerFactory : ILoggerFactory
|
|
||||||
{
|
|
||||||
public LogLevel MinimumLevel { get; set; }
|
|
||||||
|
|
||||||
public static NullLoggerFactory Instance = new NullLoggerFactory();
|
|
||||||
|
|
||||||
public ILogger CreateLogger(string name)
|
|
||||||
{
|
|
||||||
return NullLogger.Instance;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void AddProvider(ILoggerProvider provider)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Loading…
Reference in New Issue