LanguageEnglish
  • C#
  • JS

Script language

Select your preferred scripting language. All code snippets will be displayed in this language.

This version of Unity is unsupported.

Profiler.logFile

public static string logFile;

Description

Specifies the file to use when writing profiling data.

In addition to specifying a valid file path, you must set both Profiler.enabled and Profiler.enableBinaryLog to true in order to save profiling information.

using UnityEngine;
using System.Collections;
using UnityEngine.Profiling;

public class ExampleClass : MonoBehaviour { void Start() { Profiler.logFile = "mylog"; //Also supports passing "myLog.raw" Profiler.enableBinaryLog = true; Profiler.enabled = true; } }