# LogAssertionFormat

> Logs a formatted assertion message to the Unity console.

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine](/engine/6000.0/script-reference/unityengine.md)
* **Assembly:** UnityEngine.CoreModule

## LogAssertionFormat(string, Object\[])

Logs a formatted assertion message to the Unity console.

```csharp
[Conditional("UNITY_ASSERTIONS")]
public static void LogAssertionFormat(string format, params object[] args)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): A composite format string.**** (\[Object\[]]\(https\://learn.microsoft.com/dotnet/api/system.object)): 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](https://msdn.microsoft.com/en-us/library/system.diagnostics.conditionalattribute\(v=vs.110\).aspx) on the MSDN website.

## LogAssertionFormat(Object, string, Object\[])

Logs a formatted assertion message to the Unity console.

```csharp
[Conditional("UNITY_ASSERTIONS")]
public static void LogAssertionFormat(Object context, string format, params object[] args)
```

### Parameters

**** (\[Object]\(/engine/6000.0/script-reference/unityengine/object)): Object to which the message applies.**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): A composite format string.**** (\[Object\[]]\(https\://learn.microsoft.com/dotnet/api/system.object)): 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](https://msdn.microsoft.com/en-us/library/system.diagnostics.conditionalattribute\(v=vs.110\).aspx) on the MSDN website.
