ConsoleMessage Class
A message printed by the console namespace of a window (the Printer operation of the Console Standard, https://console.spec.whatwg.org/#printer), given to BrowsingContextOptions.ConsoleMessage.
public sealed class ConsoleMessageConstructors
| Name | Description |
|---|---|
| ConsoleMessage(string, ConsoleMessageLevel, string) | Creates a console message. |
ConsoleMessage(string, ConsoleMessageLevel, string)
ConsoleMessage.csCreates a console message.
public ConsoleMessage(string method, ConsoleMessageLevel level, string text)Parameters
methodstring- The name of the console method that printed the message (e.g.
log,count,timeEnd). levelConsoleMessageLevel- The severity of the message.
textstring- The text of the message.
Properties
| Name | Description |
|---|---|
| Arguments | Gets the arguments of the message, before formatting, converted as the IDL type any: the strings are .NET strings, the platform objects are their .NET objects, undefined is null, and the other values are values of the script engine. |
| GroupDepth | Gets the number of groups (console.group()) the message is in. |
| Level | Gets the severity of the message. |
| Location | Gets the location of the code that printed the message (the source file, line and column of the innermost running script), or null when the script engine cannot extract it. |
| Method | Gets the name of the console method that printed the message (the log level of the Console Standard): log, info, warn, error, debug, assert, count, countReset, time, timeLog, timeEnd, group, groupCollapsed, trace, table, dir, dirxml or clear. |
| StackTrace | Gets the call stack of a console.trace() message, or null. |
| Text | Gets the text of the message: the arguments formatted by the formatter of the Console Standard (https://console.spec.whatwg.org/#formatter), and the values that are not strings formatted as a browser console does. It is not indented by the groups (see ConsoleMessage.GroupDepth). |
Arguments
ConsoleMessage.csGets the arguments of the message, before formatting, converted as the IDL type any: the strings are .NET strings, the platform objects are their .NET objects, undefined is null, and the other values are values of the script engine.
public IReadOnlyList<object?> Arguments { get; init; }Property value
GroupDepth
ConsoleMessage.csLevel
ConsoleMessage.csLocation
ConsoleMessage.csGets the location of the code that printed the message (the source file, line and column of the innermost running script), or null when the script engine cannot extract it.
public ScriptLocation? Location { get; init; }Property value
Method
ConsoleMessage.csStackTrace
ConsoleMessage.csGets the text of the message: the arguments formatted by the formatter of the Console Standard (https://console.spec.whatwg.org/#formatter), and the values that are not strings formatted as a browser console does. It is not indented by the groups (see ConsoleMessage.GroupDepth).
public string Text { get; }Property value
Methods
| Name | Description |
|---|---|
| ToString() | Returns a string that represents the current object. |