docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class EditorGraphLogger

    A context to store and access logs provided to each nodes of a graph during an import at editor time.

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

    Constructors

    EditorGraphLogger(AssetImportContext)

    A context to store and access logs provided to each nodes of a graph at editor time.

    Declaration
    public EditorGraphLogger(AssetImportContext assetImportContext)
    Parameters
    Type Name Description
    AssetImportContext assetImportContext

    The AssetImportContext of the current import (provided by a ScriptedImporter).

    Methods

    GetAnalyticsData<T>(string)

    Get analytics data added with RegisterAnalyticsData(string, object).

    Declaration
    public T GetAnalyticsData<T>(string key)
    Parameters
    Type Name Description
    string key

    The key of the analytics data.

    Returns
    Type Description
    T

    The value corresponding to key.

    Type Parameters
    Name Description
    T

    The type of the data.

    GetErrorsForAnalytics()

    Get internal error ids and their corresponding counts registered with LogImportError(string, Object, int). An error id of value 0 is included if an exception is thrown during the import. An error id of value 1 is included if casting error is thrown in GetAnalyticsData<T>(string).

    Declaration
    public IReadOnlyDictionary<int, int> GetErrorsForAnalytics()
    Returns
    Type Description
    IReadOnlyDictionary<int, int>

    The accumulated errors and their counts during the import.

    GetWarningsForAnalytics()

    Get internal warning ids and their corresponding counts registered with LogImportWarning(string, Object, int).

    Declaration
    public IReadOnlyDictionary<int, int> GetWarningsForAnalytics()
    Returns
    Type Description
    IReadOnlyDictionary<int, int>

    The accumulated warnings and their counts during the import.

    LogImportError(string, Object, int)

    Logs import error. The error id would be accumulated if the error id is registered for analytics. The accumulated error ids and their counts during an import can be retrieved with GetErrorsForAnalytics.

    Declaration
    public override void LogImportError(string errorMessage, Object obj = null, int errorId = -1)
    Parameters
    Type Name Description
    string errorMessage

    The error message.

    Object obj

    Optional Object that is targeted by the error.

    int errorId

    The internal error id used for analytics.

    Overrides
    GraphLogger.LogImportError(string, Object, int)

    LogImportWarning(string, Object, int)

    Logs import warning. The warning id would be accumulated if the warning id is registered for analytics. The accumulated warning ids and their counts during an import can be retrieved with GetWarningsForAnalytics.

    Declaration
    public override void LogImportWarning(string warningMessage, Object obj = null, int warningId = -1)
    Parameters
    Type Name Description
    string warningMessage

    The warning message.

    Object obj

    Optional Object that is targeted by the warning.

    int warningId

    The internal warning id used for analytics.

    Overrides
    GraphLogger.LogImportWarning(string, Object, int)

    RegisterAnalyticsData(string, object)

    Add analytics data during import. Data of the same key can be retrieved with GetAnalyticsData<T>(string).

    Declaration
    public override void RegisterAnalyticsData(string key, object value)
    Parameters
    Type Name Description
    string key

    The key of the analytics data.

    object value

    The value of the analytics data.

    Overrides
    GraphLogger.RegisterAnalyticsData(string, object)
    In This Article
    Back to top
    Copyright © 2024 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)