Table of Contents

Class WarningMessage

Namespace
Gym.Utils
Assembly
Gym.dll

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

Message string

The text, str(w.message): for Logger the colourised WARN: ... line.

Category WarningCategory

The warning class.

FileName string

The source file of the call site the warning is attributed to (the C# caller, not a Python file).

LineNumber int

The line of that call site.

Properties

Category

The warning class.

public WarningCategory Category { get; init; }

Property Value

WarningCategory

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

string

LineNumber

The line of that call site.

public int LineNumber { get; init; }

Property Value

int

Message

The text, str(w.message): for Logger the colourised WARN: ... line.

public string Message { get; init; }

Property Value

string

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.