Version: 5.4

Logger

class in UnityEngine


Implementa interfaces:ILogger, ILogHandler

Cambiar al Manual

Descripción

Inicializa una nueva instancia del Logger.

Create a new instance or use default Debug.logger. See Also: ILogger, ILogHandler.

using UnityEngine;
using System.Collections;
using System.IO;
using System;

public class MyLogHandler : ILogHandler { public void LogFormat (LogType logType, UnityEngine.Object context, string format, params object[] args) { Debug.logger.logHandler.LogFormat (logType, context, format, args); }

public void LogException (Exception exception, UnityEngine.Object context) { Debug.logger.LogException (exception, context); } }

public class MyGameClass : MonoBehaviour { private static string kTAG = "MyGameTag"; private Logger myLogger;

void Start() { myLogger = new Logger(new MyLogHandler());

myLogger.Log(kTAG, "MyGameClass Start."); } }

Variables

filterLogTypeTo selective enable debug log message.
logEnabledTo runtime toggle debug logging [ON/OFF].
logHandlerDefina Logger.ILogHandler.

Constructores

LoggerCrea un Logger personalizado.

Funciones Públicas

IsLogTypeAllowedCheck logging is enabled based on the LogType.
LogRegistra un message a la Consola de Unity utilizando un logger predeterminado.
LogErrorUna variante de Logger.Log que registra un mensaje de error.
LogExceptionUna variante de Logger.Log que registra un mensaje de excepción.
LogFormatLogs a formatted message.
LogWarningUna variante de Logger.Log que registra un mensaje de advertencia.