Interface IErrorsAndWarnings
Interface for a container that handles errors, warnings, and informational messages related to a graph or its elements.
Namespace: Unity.GraphToolkit.Editor
Assembly: Unity.GraphToolkit.Editor.dll
Syntax
public interface IErrorsAndWarnings
Remarks
Implement this interface to provide logging capabilities for graph-related components. Logged messages can optionally be associated with a specific object in the graph, which enables displaying visual markers in the UI. All messages are also forwarded to the Unity Console.
Methods
Log(object, object)
Logs an informational message.
Declaration
void Log(object message, object context = null)
Parameters
Type | Name | Description |
---|---|---|
object | message | The message to display. |
object | context | Optional context object to associate with the message. The context is typically a node in the graph that the message relates to. |
Remarks
When a context
is provided, the system displays an info marker next to the specified object in the graph editor.
The message also appears in the Unity Console. If no context is given, the message is logged to the console only.
Use for communicating non-critical information.
LogError(object, object)
Logs an error message.
Declaration
void LogError(object message, object context = null)
Parameters
Type | Name | Description |
---|---|---|
object | message | The error message to display. |
object | context | Optional context object to associate with the error message. The context is typically a node in the graph that the error relates to. |
Remarks
When a context
is provided, the system displays an error marker next to the specified object in the graph editor.
The error message also appears in the Unity Console. If no context is given, the message is logged to the console only.
Use the context
parameter to help users identify the source of the issue within the graph.
Use errors for situations where Unity can not recover or proceed normally.
LogWarning(object, object)
Logs a warning message.
Declaration
void LogWarning(object message, object context = null)
Parameters
Type | Name | Description |
---|---|---|
object | message | The warning message to display. |
object | context | Optional context object to associate with the warning message. The context is typically a node in the graph that the warning relates to. |
Remarks
When a context
is provided, the system displays a warning marker next to the specified object in the graph editor.
The warning message also appears in the Unity Console. If no context is given, the message is logged to the console only.
Use the context
parameter to help users identify the source of the issue within the graph.
Use warnings for situations where Unity can recover/proceed but users may be unaware of the side effects.