Class BuildLog
Basic implementation of IBuildLogger. Stores events in memory and can dump them to the trace event format. IBuildLogger
Inherited Members
Namespace: UnityEditor.Build.Pipeline.Utilities
Assembly: Unity.ScriptableBuildPipeline.Editor.dll
Syntax
[Serializable]
public class BuildLog : IBuildLogger, IContextObject, ILogTEP
Constructors
BuildLog()
Creates a new build log object.
Declaration
public BuildLog()
Methods
AddArg(string, string)
Adds a named key/value arg to the current build step for Perfetto event annotation.
Declaration
public void AddArg(string key, string value)
Parameters
| Type | Name | Description |
|---|---|---|
| string | key | The arg key. |
| string | value | The arg value. |
AddEntry(LogLevel, string)
Adds details to the active build step
Declaration
public void AddEntry(LogLevel level, string msg)
Parameters
| Type | Name | Description |
|---|---|---|
| LogLevel | level | The log level of this entry. |
| string | msg | The message to add. |
AddMetaData(string, string)
Adds a key value pair to the MetaData list. This can be used to store things like package version numbers.
Declaration
public void AddMetaData(string key, string value)
Parameters
| Type | Name | Description |
|---|---|---|
| string | key | The key for the MetaData. |
| string | value | The value of the MetaData. |
BeginBuildStep(LogLevel, string, bool)
Should be called when beginning a build step.
Declaration
public void BeginBuildStep(LogLevel level, string stepName, bool multiThreaded)
Parameters
| Type | Name | Description |
|---|---|---|
| LogLevel | level | The log level of this step. |
| string | stepName | A name associated with the step. It is recommended that this name does not include specific context about the step; dynamic context should be added under the step as an entry. |
| bool | multiThreaded |
EndBuildStep()
Ends the build step.
Declaration
public void EndBuildStep()
FormatForTraceEventProfiler()
Converts the captured build log events into the text Trace Event Profiler format
Declaration
public string FormatForTraceEventProfiler()
Returns
| Type | Description |
|---|---|
| string | Profile data. |
ImportExternalTEP(string)
Imports events from an external Trace Event Profiler file into the current build step, so they appear alongside the host events in the formatted output.
Declaration
public void ImportExternalTEP(string tepFilePath)
Parameters
| Type | Name | Description |
|---|---|---|
| string | tepFilePath | The path of the Trace Event Profiler file to import. |