docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class GraphLogger

    Provides methods for logging messages, warnings, and errors associated with a graph.

    Inheritance
    object
    GraphLogger
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Unity.GraphToolkit.Editor
    Assembly: Unity.GraphToolkit.Editor.dll
    Syntax
    public class GraphLogger
    Remarks

    GraphLogger integrates with the Unity Console to display logs relevant to graph operations.

    When a context is provided, the message is also visually represented in the graph editor using appropriate markers (error, warning, or info).

    Console messages are only shown if the graph editor for the corresponding graph is currently open. If the editor is closed, the logs will not appear in the Unity Console.

    Methods

    Log(object, object)

    Logs an informational message.

    Declaration
    public 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
    public 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
    public 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.

    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)