Version: Unity 7.0 Alpha (7000.0)
LanguageEnglish
  • C#

AssetImporter.GetImportLog

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Declaration

public static ImportLog GetImportLog(string path);

Parameters

Parameter Description
path The path of the asset.

Returns

ImportLog The import log for the asset at path. 'null' if the asset has no import log.

Description

Retrieves logs generated during the import of the asset at path.

using UnityEngine;
using UnityEditor;

public class GetImportLogExample { [MenuItem("Tools/GetImportLogExample")] static void Example() { var assetPath = "Path/To/Your/Asset"; //Get import log for the specified asset var log = AssetImporter.GetImportLog(assetPath); //Log the import log entries if (log != null) { Debug.Log($"Import log for {assetPath}: {log.logEntries.Length} entries."); foreach (var entry in log.logEntries) { Debug.Log(entry.message); } } else { Debug.Log($"No import log found for {assetPath}"); } } }