Logging 类
提供跟踪日志记录功能。
internal class Logging
警告
此类是内部的,不应在代码中直接使用。
在任何情况下,Microsoft 都不支持在生产应用程序中使用此类。
关联方法
记录两个对象相互关联的信息。
internal static void Associate(TraceSource traceSource, object objA, object objB)
参数
traceSource
TraceSource将事件记录到的跟踪源。
objA
Object要与
objB
关联的对象。objB
Object要与
objA
关联的对象。
Enter(TraceSource, object, string, string) 方法
记录方法的入口。
internal static void Enter(TraceSource traceSource, object obj, string method, string param)
参数
traceSource
TraceSource将事件记录到的跟踪源。
obj
Object在其上调用方法的对象。
method
String正在输入的方法。
param
String传递给方法的参数。
Enter(TraceSource, object, string, object) 方法
记录方法的入口。
internal static void Enter(TraceSource traceSource, object obj, string method, object paramObject)
参数
traceSource
TraceSource将事件记录到的跟踪源。
obj
Object在其上调用方法的对象。
method
String正在输入的方法。
paramObject
Object传递给方法的参数。
Enter(TraceSource, string, string, string) 方法
记录方法的入口。
internal static void Enter(TraceSource traceSource, string obj, string method, string param)
参数
traceSource
TraceSource将事件记录到的跟踪源。
obj
String在其上调用方法的对象。
method
String正在输入的方法。
param
String传递给方法的参数。
Enter(TraceSource, string, string, object) 方法
记录方法的入口。
internal static void Enter(TraceSource traceSource, string obj, string method, object paramObject)
参数
traceSource
TraceSource将事件记录到的跟踪源。
obj
String在其上调用方法的对象。
method
String正在输入的方法。
paramObject
Object传递给方法的参数。
Enter(TraceSource, string, string) 方法
记录方法的入口。
internal static void Enter(TraceSource traceSource, string method, string parameters)
参数
traceSource
TraceSource将事件记录到的跟踪源。
method
String正在输入的方法。
parameters
String传递给方法的参数。
Enter(TraceSource, string) 方法
记录方法的入口。
internal static void Enter(TraceSource traceSource, string msg)
参数
traceSource
TraceSource将事件记录到的跟踪源。
msg
String要记录到跟踪源的入口消息。
Exception 方法
记录异常并还原缩进。
internal static void Exception(TraceSource traceSource, object obj, string method, Exception e)
参数
traceSource
TraceSource将事件记录到的跟踪源。
obj
Object在其上调用引发异常的方法的对象。
method
String引发异常的方法。
-
抛出的异常。
Exit(TraceSource, object, string, object) 方法
记录从函数退出。
internal static void Exit(TraceSource traceSource, object obj, string method, object retObject)
参数
traceSource
TraceSource将事件记录到的跟踪源。
obj
Object在其上调用方法的对象。
method
String正在退出的方法。
retObject
Object由方法返回的值。
Exit(TraceSource, string, string, object) 方法
记录从函数退出。
internal static void Exit(TraceSource traceSource, string obj, string method, object retObject)
参数
traceSource
TraceSource将事件记录到的跟踪源。
obj
String在其上调用方法的对象。
method
String正在退出的方法。
retObject
Object由方法返回的值。
Exit(TraceSource, object, string, string) 方法
记录从函数退出。
internal static void Exit(TraceSource traceSource, object obj, string method, string retValue)
参数
traceSource
TraceSource将事件记录到的跟踪源。
obj
Object在其上调用方法的对象。
method
String正在退出的方法。
retValue
String由方法返回的值。
Exit(TraceSource, string, string, string) 方法
记录从函数退出。
internal static void Exit(TraceSource traceSource, string obj, string method, string retValue)
参数
traceSource
TraceSource将事件记录到的跟踪源。
obj
String在其上调用方法的对象。
method
String正在退出的方法。
retValue
String由方法返回的值。
Exit(TraceSource, string, string) 方法
记录从函数退出。
internal static void Exit(TraceSource traceSource, string method, string parameters)
参数
traceSource
TraceSource将事件记录到的跟踪源。
method
String正在退出的方法。
parameters
String传递给正在退出的方法的参数。
Exit(TraceSource, string) 方法
记录从函数退出。
internal static void Exit(TraceSource traceSource, string msg)
参数
traceSource
TraceSource将事件记录到的跟踪源。
msg
String要记录到跟踪源的退出消息。
Http 属性
获取“System.Net.Http”的跟踪源。
internal static TraceSource Http { get; }
属性值
TraceSource
“System.Net.Http”的跟踪源,如果未启用日志记录则为 null
。
On 属性
获取一个值,该值指示是否启用日志记录。
internal static bool On { get; }
属性值
Boolean
如果启用日志记录,则为 true
;否则为 false
。
要求
命名空间:System.Net
程序集:System(在 System.dll 中)
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈