Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


LogAssertionFormat

Logs a formatted assertion message to the Unity console.
Read time 1 minuteLast updated 5 days ago

Definition

  • Type: Method
  • Namespace: UnityEngine
  • Assembly: UnityEngine.CoreModule

LogAssertionFormat(string, Object[])

Logs a formatted assertion message to the Unity console.
[Conditional("UNITY_ASSERTIONS")]public static void LogAssertionFormat(string format, params object[] args)

Parameters

format

A composite format string.

Format arguments.

Remarks

Note that these methods work only if UNITY_ASSERTIONS symbol is defined. This means that if you are building assemblies externally, you need to define this symbol otherwise the call becomes a no-op. (For more details see System.Diagnostics.ConditionalAttribute on the MSDN website.

LogAssertionFormat(Object, string, Object[])

Logs a formatted assertion message to the Unity console.
[Conditional("UNITY_ASSERTIONS")]public static void LogAssertionFormat(Object context, string format, params object[] args)

Parameters

context

Object to which the message applies.

format

A composite format string.

Format arguments.

Remarks

Note that these methods work only if UNITY_ASSERTIONS symbol is defined. This means that if you are building assemblies externally, you need to define this symbol otherwise the call becomes a no-op. (For more details see System.Diagnostics.ConditionalAttribute on the MSDN website.