Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -226,3 +226,45 @@ public interface IBufferedLogger
void LogRecords(System.Collections.Generic.IEnumerable<Microsoft.Extensions.Logging.Abstractions.BufferedLogRecord> records);
}
}
namespace Microsoft.Extensions.Logging.Abstractions.Internal
{
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
[System.ObsoleteAttribute("This type is retained only for compatibility.", error: true)]
public partial class NullScope : System.IDisposable
{
private NullScope() { }
public static Microsoft.Extensions.Logging.Abstractions.Internal.NullScope Instance { get { throw null; } }
public void Dispose() { }
Comment thread
ericstj marked this conversation as resolved.
}
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
[System.ObsoleteAttribute("This type is retained only for compatibility.", error: true)]
public partial class TypeNameHelper
{
public static string GetTypeDisplayName(System.Type type) { throw null; }
}
}
namespace Microsoft.Extensions.Logging.Internal
{
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
[System.ObsoleteAttribute("This type is retained only for compatibility. The recommended alternative is the Microsoft.Extensions.Diagnostics.Testing package.", error: true)]
Comment thread
ericstj marked this conversation as resolved.
public partial class FormattedLogValues : System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string, object?>>, System.Collections.Generic.IReadOnlyCollection<System.Collections.Generic.KeyValuePair<string, object?>>, System.Collections.Generic.IReadOnlyList<System.Collections.Generic.KeyValuePair<string, object?>>, System.Collections.IEnumerable
{
public FormattedLogValues(string? format, params object?[]? values) { }
public int Count { get { throw null; } }
Comment thread
ericstj marked this conversation as resolved.
public System.Collections.Generic.KeyValuePair<string, object?> this[int index] { get { throw null; } }
public System.Collections.Generic.IEnumerator<System.Collections.Generic.KeyValuePair<string, object?>> GetEnumerator() { throw null; }
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; }
public override string ToString() { throw null; }
}
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
[System.ObsoleteAttribute("This type is retained only for compatibility. The recommended alternative is the Microsoft.Extensions.Diagnostics.Testing package.", error: true)]
public partial class LogValuesFormatter
{
public LogValuesFormatter(string format) { }
public string OriginalFormat { get { throw null; } }
public System.Collections.Generic.List<string> ValueNames { get { throw null; } }
Comment thread
ericstj marked this conversation as resolved.
public string Format(object?[]? values) { throw null; }
public System.Collections.Generic.KeyValuePair<string, object?> GetValue(object?[] values, int index) { throw null; }
public System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string, object?>> GetValues(object[] values) { throw null; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == '$(NetCoreAppCurrent)'">
<ProjectReference Include="$(LibrariesProjectRoot)System.Collections\ref\System.Collections.csproj" />
<ProjectReference Include="$(LibrariesProjectRoot)System.Runtime\ref\System.Runtime.csproj" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;

namespace Microsoft.Extensions.Logging.Internal
{
/// <summary>
/// LogValues to enable formatting options supported by <see cref="string.Format(IFormatProvider, string, object?)"/>.
/// This also enables using {NamedFormatItem} in the format string.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
[Obsolete("This type is retained only for compatibility. The recommended alternative is the Microsoft.Extensions.Diagnostics.Testing package.", error: true)]
public class FormattedLogValues : IReadOnlyList<KeyValuePair<string, object?>>
Comment thread
ericstj marked this conversation as resolved.
{
private Microsoft.Extensions.Logging.FormattedLogValues _inner;

/// <summary>
/// Initializes a new instance of the <see cref="FormattedLogValues"/> class.
/// </summary>
/// <param name="format">The format string.</param>
/// <param name="values">The values.</param>
public FormattedLogValues(string? format, params object?[]? values)
{
_inner = new Microsoft.Extensions.Logging.FormattedLogValues(format, values);
}

/// <inheritdoc />
public KeyValuePair<string, object?> this[int index] => _inner[index];

/// <inheritdoc />
public int Count => _inner.Count;

/// <inheritdoc />
public IEnumerator<KeyValuePair<string, object?>> GetEnumerator() => _inner.GetEnumerator();

/// <inheritdoc />
IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();

/// <inheritdoc />
public override string ToString() => _inner.ToString();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System;
using System.Collections.Generic;
using System.ComponentModel;

namespace Microsoft.Extensions.Logging.Internal
{
/// <summary>
/// Formatter to convert the named format items like {NamedformatItem} to <see cref="string.Format(IFormatProvider, string, object)"/> format.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
[Obsolete("This type is retained only for compatibility. The recommended alternative is the Microsoft.Extensions.Diagnostics.Testing package.", error: true)]
public class LogValuesFormatter
Comment thread
ericstj marked this conversation as resolved.
{
private readonly Microsoft.Extensions.Logging.LogValuesFormatter _inner;

/// <summary>
/// Initializes a new instance of the <see cref="LogValuesFormatter"/> class.
/// </summary>
/// <param name="format">The named format string.</param>
public LogValuesFormatter(string format)
{
_inner = new Microsoft.Extensions.Logging.LogValuesFormatter(format);
}

/// <summary>Gets the original format string.</summary>
public string OriginalFormat => _inner.OriginalFormat;

/// <summary>Gets the list of named format parameter names.</summary>
public List<string> ValueNames => _inner.ValueNames;

/// <summary>Formats the given values using the format string.</summary>
public string Format(object?[]? values) => _inner.Format(values);

/// <summary>Gets the key/value pair for the format item at the specified index.</summary>
public KeyValuePair<string, object?> GetValue(object?[] values, int index) => _inner.GetValue(values, index);

/// <summary>Gets an enumerable of key/value pairs for all format items.</summary>
public IEnumerable<KeyValuePair<string, object?>> GetValues(object[] values) => _inner.GetValues(values);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System;
using System.ComponentModel;

namespace Microsoft.Extensions.Logging.Abstractions.Internal
{
/// <summary>
/// An empty scope without any logic.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
[Obsolete("This type is retained only for compatibility.", error: true)]
public class NullScope : IDisposable
Comment thread
ericstj marked this conversation as resolved.
{
/// <summary>
/// Returns the shared instance of <see cref="NullScope"/>.
/// </summary>
public static NullScope Instance { get; } = new NullScope();

private NullScope()
Comment thread
ericstj marked this conversation as resolved.
{
}
Comment thread
ericstj marked this conversation as resolved.

/// <inheritdoc />
public void Dispose()
{
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System;
using System.ComponentModel;

namespace Microsoft.Extensions.Logging.Abstractions.Internal
{
/// <summary>
/// Helper to process type names.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
[Obsolete("This type is retained only for compatibility.", error: true)]
public class TypeNameHelper
{
/// <summary>Pretty prints a type name.</summary>
public static string GetTypeDisplayName(Type type)
=> Microsoft.Extensions.Internal.TypeNameHelper.GetTypeDisplayName(type);
Comment thread
ericstj marked this conversation as resolved.
}
}
Loading