Class WarningMessage
One issued warning, as Python's warnings.catch_warnings(record=True) records it.
public sealed record WarningMessage : IEquatable<WarningMessage>
- Inheritance
-
WarningMessage
- Implements
- Inherited Members
- Extension Methods
Constructors
WarningMessage(string, WarningCategory, string, int)
One issued warning, as Python's warnings.catch_warnings(record=True) records it.
public WarningMessage(string Message, WarningCategory Category, string FileName, int LineNumber)
Parameters
MessagestringThe text,
str(w.message): for Logger the colourisedWARN: ...line.CategoryWarningCategoryThe warning class.
FileNamestringThe source file of the call site the warning is attributed to (the C# caller, not a Python file).
LineNumberintThe line of that call site.
Properties
Category
The warning class.
public WarningCategory Category { get; init; }
Property Value
FileName
The source file of the call site the warning is attributed to (the C# caller, not a Python file).
public string FileName { get; init; }
Property Value
LineNumber
The line of that call site.
public int LineNumber { get; init; }
Property Value
Message
The text, str(w.message): for Logger the colourised WARN: ... line.
public string Message { get; init; }
Property Value
Methods
ToString()
The line Python's warnings.formatwarning prints for the warning (without the source line Python appends
when it can read the file): file:line: Category: message.
public override string ToString()
Returns
- string
The formatted warning, without a trailing newline.