Microsoft.Extensions.Logging.Debug 8.0.0
前缀已预留
见下面的版本列表以获取详细信息。
dotnet add package Microsoft.Extensions.Logging.Debug --version 8.0.0
NuGet\Install-Package Microsoft.Extensions.Logging.Debug -Version 8.0.0
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.0" />
paket add Microsoft.Extensions.Logging.Debug --version 8.0.0
#r "nuget: Microsoft.Extensions.Logging.Debug, 8.0.0"
// Install Microsoft.Extensions.Logging.Debug as a Cake Addin #addin nuget:?package=Microsoft.Extensions.Logging.Debug&version=8.0.0 // Install Microsoft.Extensions.Logging.Debug as a Cake Tool #tool nuget:?package=Microsoft.Extensions.Logging.Debug&version=8.0.0
关于
Microsoft.Extensions.Logging.Debug
为Microsoft.Extensions.Logging提供调试输出记录库的实现。该记录库通过使用System.Diagnostics.Debug.WriteLine()
将消息写入调试器监视器来记录消息。
主要功能
- 允许将日志记录到调试器输出。
- 为ILoggingBuilder类提供扩展方法,以方便启用此调试记录库。
如何使用
using System;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Debug;
namespace DebugLoggerSample
{
class Program
{
static void Main(string[] args)
{
// Create a logger factory with a debug provider
using ILoggerFactory loggerFactory = LoggerFactory.Create(builder => builder.AddDebug());
// Create a logger with the category name of the current class
ILogger<Program> logger = loggerFactory.CreateLogger<Program>();
// Log some messages with different log levels and message templates
logger.LogTrace("This is a trace message.");
logger.LogDebug("This is a debug message.");
logger.LogInformation("Hello {Name}!", "World");
logger.LogWarning("This is a warning message.");
logger.LogError("This is an error message.");
logger.LogCritical("This is a critical message.");
// Use structured logging to capture complex data
var person = new Person { Name = "Alice", Age = 25 };
logger.LogInformation("Created a new person: {@Person}", person);
// Use exception logging to capture the details of an exception
try
{
throw new Exception("Something went wrong.");
}
catch (Exception ex)
{
logger.LogError(ex, "An exception occurred.");
}
Console.WriteLine("Press any key to exit.");
Console.ReadKey();
}
}
// A simple class to demonstrate structured logging
class Person
{
public string Name { get; set; }
public int Age { get; set; }
}
}
主要类型
此库提供的主要类型包括
DebugLoggerProvider
DebugLoggerFactoryExtensions
其他文档
相关包
Microsoft.Extensions.Logging.Abstractions Microsoft.Extensions.Logging Microsoft.Extensions.Logging.Console Microsoft.Extensions.Logging.EventSource Microsoft.Extensions.Logging.EventLog Microsoft.Extensions.Logging.TraceSource
反馈与贡献
Microsoft.Extensions.Logging.Debug以开源形式发布,采用MIT许可证。欢迎在GitHub仓库提交错误报告和贡献。
产品 | 版本 兼容以及额外的计算目标框架版本。 |
---|---|
.NET | |
.NET Core | |
.NET Standard | |
.NET Framework | net461 已计算。 net462 兼容。 net463 已计算。 net47 已计算。 net471 已计算。 net472 已计算。 net48 已计算。 net481 已计算。 |
MonoAndroid | monoandroid 已计算。 |
MonoMac | monomac 已计算。 |
MonoTouch | monotouch 已计算。 |
Tizen | tizen40 已计算。 tizen60 已计算。 |
Xamarin.iOS | xamarinios 已计算。 |
Xamarin.Mac | xamarinmac 已计算。 |
Xamarin.TVOS | xamarintvos 已计算。 |
Xamarin.WatchOS | xamarinwatchos 已计算。 |
-
.NETFramework 4.6.2
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 8.0.0)
- Microsoft.Extensions.Logging (>= 8.0.0)
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.0)
-
.NETStandard 2.0
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 8.0.0)
- Microsoft.Extensions.Logging (>= 8.0.0)
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.0)
-
net6.0
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 8.0.0)
- Microsoft.Extensions.Logging (>= 8.0.0)
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.0)
-
net7.0
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 8.0.0)
- Microsoft.Extensions.Logging (>= 8.0.0)
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.0)
-
net8.0
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 8.0.0)
- Microsoft.Extensions.Logging (>= 8.0.0)
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.0)
NuGet 包 (545)
显示依赖 Microsoft.Extensions.Logging.Debug 的前 5 个 NuGet 包
包 | 下载 |
---|---|
Microsoft Expeditions.Hosting 为应用程序提供托管和启动基础设施。 |
|
Microsoft.AspNetCore Microsoft.AspNetCore |
|
Microsoft.AspNetCore.App 提供构建 ASP.NET Core 应用程序的默认 API 集合。此包需要 ASP.NET Core 运行时。该运行时由 .NET Core SDK 安装,或者可以通过 https://aka.ms/dotnet-download 上的安装程序单独获取。 |
|
Microsoft.AspNetCore.All 提供构建 ASP.NET Core 应用程序的默认 API 集合,并包括与 ASP.NET Core 的第三方集成 API。此包需要 ASP.NET Core 运行时。该运行时由 .NET Core SDK 安装,或者可以通过 https://aka.ms/dotnet-download 上的安装程序单独获取。 |
|
ApacheThrift
Apache Thrift RPC 系统的 C# .NET Core 绑定 |
GitHub 仓库 (365)
显示依赖 Microsoft.Extensions.Logging.Debug 的前 5 个最受欢迎的 GitHub 仓库
仓库 | 星星 |
---|---|
dotnet/maui
.NET MAUI 是一个跨移动、平板和桌面设备的原生设备应用程序框架
|
|
dotnet/AspNetCore.Docs
ASP.NET Core 文档
|
|
unoplatform/uno
使用 C# 和 XAML 开发移动、桌面和 WebAssembly 应用程序。今天。开源且受专业支持。
|
|
JeffreySu/WeiXinMPSDK
微信全平台 .NET SDK, Senparc.Weixin for C#,支持 .NET Framework 及 .NET Core、.NET 8.0。已支持微信公众号、小程序、小游戏、微信支付、企业微信/企业号、开放平台、JSSDK、微信周边等全平台。 WeChat SDK for C#.
|
|
ThreeMammals/Ocelot
.NET API 网关
|
版本 | 下载 | 最后更新 | |
---|---|---|---|
9.0.0-preview.7.24405.7 | 1,134 | 8/13/2024 | |
9.0.0-preview.6.24327.7 | 18,919 | 7/9/2024 | |
9.0.0-preview.5.24306.7 | 16,856 | 6/11/2024 | |
9.0.0-preview.4.24266.19 | 15,309 | 5/21/2024 | |
9.0.0-preview.3.24172.9 | 77,702 | 4/11/2024 | |
9.0.0-preview.2.24128.5 | 20,846 | 3/12/2024 | |
9.0.0-preview.1.24080.9 | 43,076 | 2/13/2024 | |
8.0.0 | 39,868,922 | 11/14/2023 | |
8.0.0-rc.2.23479.6 | 141,753 | 10/10/2023 | |
8.0.0-rc.1.23419.4 | 110,680 | 9/12/2023 | |
8.0.0-preview.7.23375.6 | 53,478 | 8/8/2023 | |
8.0.0-preview.6.23329.7 | 70,221 | 7/11/2023 | |
8.0.0-preview.5.23280.8 | 51,228 | 6/13/2023 | |
8.0.0-preview.4.23259.5 | 172,466 | 5/16/2023 | |
8.0.0-preview.3.23174.8 | 62,547 | 4/11/2023 | |
8.0.0-preview.2.23128.3 | 29,250 | 3/14/2023 | |
8.0.0-preview.1.23110.8 | 86,106 | 2/21/2023 | |
7.0.0 | 62,430,539 | 11/7/2022 | |
7.0.0-rc.2.22472.3 | 143,418 | 10/11/2022 | |
7.0.0-rc.1.22426.10 | 79,634 | 9/14/2022 | |
7.0.0-preview.7.22375.6 | 53,007 | 8/9/2022 | |
7.0.0-preview.6.22324.4 | 43,051 | 7/12/2022 | |
7.0.0-preview.5.22301.12 | 41,744 | 6/14/2022 | |
7.0.0-preview.4.22229.4 | 44,477 | 5/10/2022 | |
7.0.0-preview.3.22175.4 | 40,484 | 4/13/2022 | |
7.0.0-preview.2.22152.2 | 13,782 | 3/14/2022 | |
7.0.0-preview.1.22076.8 | 24,329 | 2/17/2022 | |
6.0.0 | 152,601,322 | 11/8/2021 | |
6.0.0-rc.2.21480.5 | 365,328 | 10/12/2021 | |
6.0.0-rc.1.21451.13 | 254,897 | 9/14/2021 | |
6.0.0-preview.7.21377.19 | 125,229 | 8/10/2021 | |
6.0.0-preview.6.21352.12 | 44,557 | 7/14/2021 | |
6.0.0-preview.5.21301.5 | 29,413 | 6/15/2021 | |
6.0.0-preview.4.21253.7 | 18,483 | 5/24/2021 | |
6.0.0-preview.3.21201.4 | 34,479 | 4/8/2021 | |
6.0.0-preview.2.21154.6 | 79,883 | 3/11/2021 | |
6.0.0-preview.1.21102.12 | 33,649 | 2/12/2021 | |
5.0.0 | 88,528,610 | 11/9/2020 | |
5.0.0-rc.2.20475.5 | 86,514 | 10/13/2020 | |
5.0.0-rc.1.20451.14 | 46,862 | 9/14/2020 | |
5.0.0-preview.8.20407.11 | 27,153 | 8/25/2020 | |
5.0.0-preview.7.20364.11 | 34,142 | 7/21/2020 | |
5.0.0-preview.6.20305.6 | 24,503 | 6/25/2020 | |
5.0.0-preview.5.20278.1 | 12,286 | 6/10/2020 | |
5.0.0-preview.4.20251.6 | 27,729 | 5/18/2020 | |
5.0.0-preview.3.20215.2 | 15,247 | 4/23/2020 | |
5.0.0-preview.2.20160.3 | 120,462 | 4/2/2020 | |
5.0.0-preview.1.20120.4 | 27,024 | 3/16/2020 | |
3.1.32 | 1,349,092 | 12/13/2022 | |
3.1.31 | 462,227 | 11/8/2022 | |
3.1.30 | 785,755 | 10/11/2022 | |
3.1.29 | 264,412 | 9/13/2022 | |
3.1.28 | 411,897 | 8/9/2022 | |
3.1.27 | 327,309 | 7/12/2022 | |
3.1.26 | 281,464 | 6/14/2022 | |
3.1.25 | 389,541 | 5/10/2022 | |
3.1.24 | 343,271 | 4/11/2022 | |
3.1.23 | 710,178 | 3/8/2022 | |
3.1.22 | 6,573,428 | 12/14/2021 | |
3.1.21 | 1,537,769 | 11/7/2021 | |
3.1.20 | 753,617 | 10/11/2021 | |
3.1.19 | 809,166 | 9/14/2021 | |
3.1.18 | 1,768,409 | 8/10/2021 | |
3.1.17 | 1,275,156 | 7/13/2021 | |
3.1.16 | 1,660,128 | 6/8/2021 | |
3.1.15 | 2,229,687 | 5/11/2021 | |
3.1.14 | 2,231,942 | 4/6/2021 | |
3.1.13 | 2,324,181 | 3/9/2021 | |
3.1.12 | 2,301,819 | 2/9/2021 | |
3.1.11 | 2,541,848 | 1/12/2021 | |
3.1.10 | 5,920,673 | 11/9/2020 | |
3.1.9 | 7,682,445 | 10/13/2020 | |
3.1.8 | 10,219,048 | 9/8/2020 | |
3.1.7 | 6,605,379 | 8/11/2020 | |
3.1.6 | 9,138,391 | 7/14/2020 | |
3.1.5 | 10,590,828 | 6/9/2020 | |
3.1.4 | 6,958,293 | 5/12/2020 | |
3.1.3 | 11,057,697 | 3/24/2020 | |
3.1.2 | 9,981,897 | 2/18/2020 | |
3.1.1 | 9,173,328 | 1/14/2020 | |
3.1.0 | 20,974,986 | 12/3/2019 | |
3.1.0-preview3.19553.2 | 34,163 | 11/13/2019 | |
3.1.0-preview2.19525.4 | 30,039 | 11/1/2019 | |
3.1.0-preview1.19506.1 | 873,749 | 10/15/2019 | |
3.0.3 | 250,865 | 2/18/2020 | |
3.0.2 | 735,554 | 1/14/2020 | |
3.0.1 | 1,314,130 | 11/18/2019 | |
3.0.0 | 17,457,758 | 9/23/2019 | |
3.0.0-rc1.19456.10 | 27,394 | 9/16/2019 | |
3.0.0-preview9.19423.4 | 48,768 | 9/4/2019 | |
3.0.0-preview8.19405.4 | 82,647 | 8/13/2019 | |
3.0.0-preview7.19362.4 | 52,387 | 7/23/2019 | |
3.0.0-preview6.19304.6 | 57,733 | 6/12/2019 | |
3.0.0-preview5.19227.9 | 80,886 | 5/6/2019 | |
3.0.0-preview4.19216.2 | 10,945 | 4/18/2019 | |
3.0.0-preview3.19153.1 | 43,692 | 3/6/2019 | |
3.0.0-preview.19074.2 | 84,332 | 1/29/2019 | |
3.0.0-preview.18572.1 | 3,092 | 12/4/2018 | |
2.2.0 | 60,737,259 | 12/3/2018 | |
2.2.0-preview3-35497 | 89,481 | 10/17/2018 | |
2.2.0-preview2-35157 | 24,938 | 9/12/2018 | |
2.2.0-preview1-35029 | 18,951 | 8/22/2018 | |
2.1.1 | 32,878,588 | 6/18/2018 | |
2.1.0 | 8,047,033 | 5/29/2018 | |
2.1.0-rc1-final | 58,428 | 5/6/2018 | |
2.1.0-preview2-final | 37,634 | 4/10/2018 | |
2.1.0-preview1-final | 116,140 | 2/26/2018 | |
2.0.2 | 5,126,122 | 5/7/2018 | |
2.0.1 | 6,180,481 | 3/13/2018 | |
2.0.0 | 24,957,799 | 8/11/2017 | |
2.0.0-preview2-final | 86,412 | 6/28/2017 | |
2.0.0-preview1-final | 51,763 | 5/10/2017 | |
1.1.2 | 2,348,558 | 5/9/2017 | |
1.1.1 | 2,226,185 | 3/6/2017 | |
1.1.0 | 1,070,221 | 11/16/2016 | |
1.1.0-preview1-final | 12,005 | 10/24/2016 | |
1.0.2 | 1,320,581 | 3/6/2017 | |
1.0.1 | 486,355 | 12/12/2016 | |
1.0.0 | 2,827,126 | 6/27/2016 | |
1.0.0-rc2-final | 70,805 | 5/16/2016 | |
1.0.0-rc1-final | 279,169 | 11/18/2015 |