Version: 2019.2
public bool logEnabled ;

説明

ランタイムでデバッグをログしてる最中に [オン/オフ] を切り替えます。

using UnityEngine;
using System.Collections;

public class MyGameClass : MonoBehaviour { private static ILogger logger = Debug.unityLogger; private static string kTAG = "MyGameTag";

void Start() { logger.logEnabled = Debug.isDebugBuild;

logger.Log(kTAG, "This log will be displayed only in debug build"); } }