Logging 类
提供跟踪日志记录功能。
internal class Logging
警告
此类是内部类,不应直接在代码中使用。
Microsoft在任何情况下都不支持在生产应用程序中使用此类。
Associate 方法
记录两个对象相互关联的信息。
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要记录到跟踪源的入口消息。
异常方法
记录异常并还原缩进。
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.dll)