// Copyright (c) .NET Foundation. 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.Extensions.Logging; namespace Microsoft.Net.Http.Server { internal class NullLogger : ILogger { public static readonly NullLogger Instance = new NullLogger(); public IDisposable BeginScope(TState state) { return NullDisposable.Instance; } public void Log(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func formatter) { } public bool IsEnabled(LogLevel logLevel) { return false; } private class NullDisposable : IDisposable { public static readonly NullDisposable Instance = new NullDisposable(); public void Dispose() { // intentionally does nothing } } } }