# C++ DEBUG MACROS

*Drop‑in, **type‑safe** replacements for `UE_LOG`, `GEngine->AddOnScreenDebugMessage`, and `DrawDebugString` — Easy log macros for C++ Devs. Pass variadic arguments of any type to convert and print with configurable presets*

***

## 🛠️How to Setup

<figure><img src="https://1894265510-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2MlvUNOxZQqS2bQU0OML%2Fuploads%2F71IWKYrTk6H1TjgLTCKB%2FMacrosSetup.png?alt=media&#x26;token=203cc713-fb38-4a65-aa11-ba45771ef444" alt=""><figcaption></figcaption></figure>

***

## 1️⃣ Log with Pre-defined Presets

<figure><img src="https://1894265510-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2MlvUNOxZQqS2bQU0OML%2Fuploads%2FUBfKLRiX6PFxHrYakNtj%2FMacroOverview.png?alt=media&#x26;token=ef1e4fbc-d4c0-4251-97d8-d0db246fa97a" alt=""><figcaption></figcaption></figure>

These pre-defined presets can be changed in plugin settings which will affect these macros color, duration, severity and print mode.&#x20;

<table><thead><tr><th width="225.39996337890625">Macro</th><th width="168.7333984375" valign="top">Output Target</th><th width="140.2000732421875">Severity</th><th width="106.3333740234375">Color</th><th>Duration</th><th>Key</th></tr></thead><tbody><tr><td><code>PrintInfo(...)</code></td><td valign="top">Screen + Log</td><td>Info</td><td>🟢 </td><td>3.0</td><td>None</td></tr><tr><td><code>PrintWarn(...)</code></td><td valign="top">Screen + Log</td><td>Warn</td><td>🟡 </td><td>5.0</td><td>None</td></tr><tr><td><code>PrintError(...)</code></td><td valign="top">Screen + Log</td><td>Error</td><td>🔴 </td><td>7.0</td><td>None</td></tr><tr><td><code>LogInfo(...)</code></td><td valign="top">Log only</td><td>Info</td><td>🟢</td><td>0.0</td><td>None</td></tr><tr><td><code>LogWarn(...)</code></td><td valign="top">Log only</td><td>Warn</td><td>🟡 </td><td>0.0</td><td>None</td></tr><tr><td><code>LogError(...)</code></td><td valign="top">Log only</td><td>Error</td><td>🔴 </td><td>0.0</td><td>None</td></tr><tr><td><code>Print3D(Location, ...)</code></td><td valign="top">World + Log</td><td>Info</td><td>🟠 </td><td>5.0</td><td>None</td></tr></tbody></table>

***

## 2️⃣ Log with Custom Presets

<figure><img src="https://1894265510-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2MlvUNOxZQqS2bQU0OML%2Fuploads%2Fi5EqjYvoQPUFsxz9P6eL%2FCustomMacro.png?alt=media&#x26;token=6822eb72-aaea-4361-a8a2-6be6dd06aa84" alt=""><figcaption></figcaption></figure>

More Custom macros can be added in the ALS\_Macro.h file. Feel free to adjust them to your preference accordingly.

<table data-full-width="false"><thead><tr><th width="750" valign="middle">Macro</th></tr></thead><tbody><tr><td valign="middle"><code>PrintCustom(PrintConfig, ...)</code></td></tr><tr><td valign="middle"><code>Print3DCustom(PrintConfig, Location, ...)</code></td></tr><tr><td valign="middle"><code>PrintPreset(Preset, ...)</code></td></tr><tr><td valign="middle"><code>LogPreset(Preset, ...)</code></td></tr><tr><td valign="middle"><code>JustPrint(zPreset, ...)</code></td></tr><tr><td valign="middle"><code>JustLog(Preset, ...)</code></td></tr><tr><td valign="middle"><code>ALSFileLog(Message, Severity)</code></td></tr><tr><td valign="middle"><code>ConvertToStringALS(Arg)</code></td></tr></tbody></table>

***

## You can also:

* Toggle file logging.
* Change default on‑screen duration & colour.
* Globally enable/disable 3‑D debug strings.

All from **Project Settings → Plugins → ALS**.

***
