Log
Logs message to the Unity Console using default logger.
Read time 3 minutesLast updated 5 days ago
Definition
- Type: Method
- Namespace: UnityEngine
- Assembly: UnityEngine.CoreModule
Log(LogType, Object)
Logs message to the Unity Console using default logger.
public void Log(LogType logType, object message)
Parameters
Remarks
Additional Resources: ILogger, ILogHandler.
Examples
using UnityEngine;using System.Collections;public class MyGameClass : MonoBehaviour{ private static ILogger logger = Debug.unityLogger; private static string kTAG = "MyGameTag"; void MyGameMethod() { logger.Log(kTAG, "Hello"); Debug.unityLogger.Log(kTAG, "World"); logger.Log("Hello Logger"); }}
Log(LogType, Object, Object)
Logs message to the Unity Console using default logger.
public void Log(LogType logType, object message, Object context)
Parameters
Remarks
Additional Resources: ILogger, ILogHandler.
Examples
using UnityEngine;using System.Collections;public class MyGameClass : MonoBehaviour{ private static ILogger logger = Debug.unityLogger; private static string kTAG = "MyGameTag"; void MyGameMethod() { logger.Log(kTAG, "Hello"); Debug.unityLogger.Log(kTAG, "World"); logger.Log("Hello Logger"); }}
Log(LogType, string, Object)
Logs message to the Unity Console using default logger.
public void Log(LogType logType, string tag, object message)
Parameters
Remarks
Additional Resources: ILogger, ILogHandler.
Examples
using UnityEngine;using System.Collections;public class MyGameClass : MonoBehaviour{ private static ILogger logger = Debug.unityLogger; private static string kTAG = "MyGameTag"; void MyGameMethod() { logger.Log(kTAG, "Hello"); Debug.unityLogger.Log(kTAG, "World"); logger.Log("Hello Logger"); }}
Log(LogType, string, Object, Object)
Logs message to the Unity Console using default logger.
public void Log(LogType logType, string tag, object message, Object context)
Parameters
Remarks
Additional Resources: ILogger, ILogHandler.
Examples
using UnityEngine;using System.Collections;public class MyGameClass : MonoBehaviour{ private static ILogger logger = Debug.unityLogger; private static string kTAG = "MyGameTag"; void MyGameMethod() { logger.Log(kTAG, "Hello"); Debug.unityLogger.Log(kTAG, "World"); logger.Log("Hello Logger"); }}
Log(Object)
Logs message to the Unity Console using default logger.
public void Log(object message)
Parameters
String or object to be converted to string representation for display.
Remarks
Additional Resources: ILogger, ILogHandler.
Examples
using UnityEngine;using System.Collections;public class MyGameClass : MonoBehaviour{ private static ILogger logger = Debug.unityLogger; private static string kTAG = "MyGameTag"; void MyGameMethod() { logger.Log(kTAG, "Hello"); Debug.unityLogger.Log(kTAG, "World"); logger.Log("Hello Logger"); }}
Log(string, Object)
Logs message to the Unity Console using default logger.
public void Log(string tag, object message)
Parameters
Remarks
Additional Resources: ILogger, ILogHandler.
Examples
using UnityEngine;using System.Collections;public class MyGameClass : MonoBehaviour{ private static ILogger logger = Debug.unityLogger; private static string kTAG = "MyGameTag"; void MyGameMethod() { logger.Log(kTAG, "Hello"); Debug.unityLogger.Log(kTAG, "World"); logger.Log("Hello Logger"); }}
Log(string, Object, Object)
Logs message to the Unity Console using default logger.
public void Log(string tag, object message, Object context)
Parameters
Remarks
Additional Resources: ILogger, ILogHandler.
Examples
using UnityEngine;using System.Collections;public class MyGameClass : MonoBehaviour{ private static ILogger logger = Debug.unityLogger; private static string kTAG = "MyGameTag"; void MyGameMethod() { logger.Log(kTAG, "Hello"); Debug.unityLogger.Log(kTAG, "World"); logger.Log("Hello Logger"); }}