# SetValidationErrorLoggingSuppressed(bool)

> Controls whether graphics API validation errors are logged immediately as the debug layer reports them.

## Definition

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

```csharp
public static void SetValidationErrorLoggingSuppressed(bool suppressed)
```

### Parameters

**** (\[bool]\(https\://learn.microsoft.com/dotnet/api/system.boolean)): Whether to suppress immediate logging of validation errors.

### Remarks

When suppressed, errors are still accumulated and can be retrieved with [GraphicsApiValidation.GetValidationErrorCount](/engine/6000.7/script-reference/unityengine/rendering/graphicsapivalidation/getvalidationerrorcount.md) and [GraphicsApiValidation.GetValidationError](/engine/6000.7/script-reference/unityengine/rendering/graphicsapivalidation/getvalidationerror.md), but the caller is responsible for logging them. Test frameworks typically suppress logging to avoid race conditions between asynchronous validation callbacks and test teardown.

Additional Resources: [GraphicsApiValidation.IsValidationErrorLoggingSuppressed](/engine/6000.7/script-reference/unityengine/rendering/graphicsapivalidation/isvalidationerrorloggingsuppressed.md).

### Examples

```csharp
using UnityEngine;
using UnityEngine.Rendering;

public class Example : MonoBehaviour
{
    void RunWithSuppressedLogging()
    {
        bool wasSuppressed = GraphicsApiValidation.IsValidationErrorLoggingSuppressed();
        GraphicsApiValidation.SetValidationErrorLoggingSuppressed(true);
        try
        {
            // ... run code that issues graphics commands ...
        }
        finally
        {
            GraphicsApiValidation.SetValidationErrorLoggingSuppressed(wasSuppressed);
        }
    }
}
```
