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

    引发异常的方法。

  • e Exception

    抛出的异常。

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 中)