Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


Logger(ILogHandler)

Create a custom Logger.
Read time 1 minuteLast updated 4 days ago

Definition

  • Type: Constructor
  • Namespace: UnityEngine
  • Assembly: UnityEngine.CoreModule
public Logger(ILogHandler logHandler)

Parameters

logHandler

Pass in default log handler or custom log handler.

Remarks

Additional Resources: ILogHandler, Debug.unityLogger.

Examples

using UnityEngine;using System.Collections;public class MyGameClass : MonoBehaviour{ private static string kTAG = "MyGameTag"; private Logger myLogger; void Start() { myLogger = new Logger(Debug.unityLogger.logHandler); myLogger.Log(kTAG, "MyGameClass Start."); }}