TraceSource.TraceInformation Method
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Writes an informational message to the trace listeners in the Listeners collection.
TraceInformation(String) |
Writes an informational message to the trace listeners in the Listeners collection using the specified message. |
TraceInformation(String, Object[]) |
Writes an informational message to the trace listeners in the Listeners collection using the specified object array and formatting information. |
- Source:
- TraceSource.cs
- Source:
- TraceSource.cs
- Source:
- TraceSource.cs
Writes an informational message to the trace listeners in the Listeners collection using the specified message.
public:
void TraceInformation(System::String ^ message);
[System.Diagnostics.Conditional("TRACE")]
public void TraceInformation (string message);
[System.Diagnostics.Conditional("TRACE")]
public void TraceInformation (string? message);
[<System.Diagnostics.Conditional("TRACE")>]
member this.TraceInformation : string -> unit
Public Sub TraceInformation (message As String)
Parameters
- message
- String
The informative message to write.
- Attributes
Exceptions
An attempt was made to trace an event during finalization.
Remarks
The TraceInformation method provides an informational message intended to be read by users and not by tools.
TraceInformation(String) calls the TraceEvent(TraceEventType, Int32, String) method, setting eventType
to TraceEventType.Information and passing the informative message as the message string. The TraceEvent(TraceEventType, Int32, String) method in turn calls the TraceEvent(TraceEventCache, String, TraceEventType, Int32, String) method of each trace listener.
Applies to
.NET 9 and other versions
Product | Versions |
---|---|
.NET | Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9 |
.NET Framework | 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 2.0, 2.1 |
- Source:
- TraceSource.cs
- Source:
- TraceSource.cs
- Source:
- TraceSource.cs
Writes an informational message to the trace listeners in the Listeners collection using the specified object array and formatting information.
public:
void TraceInformation(System::String ^ format, ... cli::array <System::Object ^> ^ args);
[System.Diagnostics.Conditional("TRACE")]
public void TraceInformation (string format, params object?[]? args);
[System.Diagnostics.Conditional("TRACE")]
public void TraceInformation (string? format, params object?[]? args);
[System.Diagnostics.Conditional("TRACE")]
public void TraceInformation (string format, params object[] args);
[<System.Diagnostics.Conditional("TRACE")>]
member this.TraceInformation : string * obj[] -> unit
Public Sub TraceInformation (format As String, ParamArray args As Object())
Parameters
- format
- String
A composite format string that contains text intermixed with zero or more format items, which correspond to objects in the args
array.
- args
- Object[]
An array containing zero or more objects to format.
- Attributes
Exceptions
format
is null
.
format
is invalid.
-or-
The number that indicates an argument to format is less than zero, or greater than or equal to the number of specified objects to format.
An attempt was made to trace an event during finalization.
Remarks
For more information about the format
parameter, see Composite Formatting.
The TraceInformation method provides an informational message intended to be read by users and not by tools.
TraceInformation(String, Object[]) calls the TraceEvent(TraceEventType, Int32, String, Object[]) method, setting eventType
to TraceEventType.Information and passing the message content as an object array with formatting information. The TraceEvent(TraceEventType, Int32, String, Object[]) method in turn calls the TraceEvent(TraceEventCache, String, TraceEventType, Int32, String, Object[]) method of each trace listener.
See also
- Composite Formatting
- Standard Numeric Format Strings
- Custom Numeric Format Strings
- Standard DateTime Format Strings
- Custom DateTime Format Strings
- Enumeration Format Strings
- Formatting Types in .NET
Applies to
.NET 9 and other versions
Product | Versions |
---|---|
.NET | Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9 |
.NET Framework | 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 2.0, 2.1 |
.NET feedback
.NET is an open source project. Select a link to provide feedback: